[Bounty proposal] fix(ms365-app): prevent internal exception leaks and sanitize tool dispatch error responses ($50 proposed)
Following the contribution guide's invitation to propose paid work — @kodjima33, @josancamon19, would a US\ bounty be appropriate for this? Proposed amount, not an existing award. Fix and hermetic tests are already submitted and verified in PR #15601.
Symptom
In plugins/omi-ms365-app/main.py, the _auth_guard helper and tool_dispatch endpoint previously risked leaking internal exception text, OAuth descriptions, and stack traces into user-facing HTTP responses:
_auth_guardcaughtauth.AuthError as eand raisedHTTPException(401, f"Microsoft not connected — {e}"), reflecting upstream OAuth error strings directly into the client response.- In
tool_dispatch,TypeError as ewas caught and reflected intoHTTPException(400, f"Bad arguments for {tool_name}: {e}"), exposing Python argument names and internal traceback frames. - Unexpected runtime errors or upstream Graph/network failures in tool handlers were completely unhandled at the dispatch boundary, leading to unhandled 500 runtime crashes.
What changed
- Sanitized Auth Guard: Updated
_auth_guardto log full exception context server-side withlog.warningwhile returning a fixed, clean user-facing detail ("Microsoft not connected — please connect in settings."). - Sanitized Dispatch Errors: Sanitized
TypeErrorhandling to return cleanf"Bad arguments for {tool_name}"and added structuredHTTPException/Exceptionguards catching unexpected faults and Graph errors with server-side error logging (log.error(..., exc_info=True)). - Hermetic Regression Test Suite: Added
plugins/omi-ms365-app/test_error_handling.py(4 tests, passing under plainpython3 -S) validating that token errors, internal IPs, credentials, and stack traces never leak across dispatch or auth boundaries. - Checks Manifest: Registered
ms365-error-handling-testsin.github/checks-manifest.yaml. All 52 plugin and hermetic tests pass.
PR: #15601
Destination: Base / EVM (gewenbo.eth / 0x240C74A953Fc04Fe8cD713c68b53e94d9b449F8C)
Claiming this proposal. Implementing exception sanitization + hermetic tests.
Payout (PayPal): [email protected]
Standing down this claim — on closer look the linked PRs are already up (#15601 / #15599 / #15587 by @gewenbo888, or already merged for wikipedia). Not competing with an existing delivery. PayPal claim withdrawn for this issue.
This task is already completed and submitted via PR #15601 by @gewenbo888.
- Current Blocker: None (PR submitted, awaiting maintainer review).
- Acceptance Criterion: Full hermetic regression test suite passing (52/52 tests), OAuth and tool dispatch exceptions sanitized.
- Confirmed Payout Path: EVM (Base Mainnet):
0x240C74A953Fc04Fe8cD713c68b53e94d9b449F8C(gewenbo.eth)
@autonoma-avalix Please note this task is already delivered.
Thanks for putting this together. We aren't doing bounties at the moment, so we're closing the bounty proposal issues for now — thanks for the fix! 🙏