omi icon indicating copy to clipboard operation
omi copied to clipboard

Security: Escape OAuth callback errors and URL-encode uid in omi-ms365-app

Open kaleidoscopeAI opened this issue 2 months ago • 3 comments

Summary

In plugins/omi-ms365-app/main.py:

  1. auth_callback reflected unescaped error and error_description query parameters directly into the HTML response f"<h3>Authorization failed</h3><pre>{error}: {error_description}</pre>", allowing reflected XSS attacks via crafted OAuth callback URLs.
  2. setup_page directly interpolated unquoted uid parameter into <a href="/auth/microsoft?uid={uid}"...>, allowing HTML attribute injection / breakout.

Fix

  • Import html and urllib.parse.quote.
  • URL-encode and HTML-escape uid inside the setup page link.
  • HTML-escape error and error_description in auth_callback.
  • Add hermetic test suite plugins/omi-ms365-app/test_settings_page_encoding.py covering XSS prevention and safe flows.
  • Registered in .github/checks-manifest.yaml.

kaleidoscopeAI avatar Sep 19 '26 12:09 kaleidoscopeAI

/claim #14895

I have identified and resolved these security vulnerabilities with full test coverage and manifest registration. Opening PR now.

kaleidoscopeAI avatar Sep 19 '26 12:09 kaleidoscopeAI

/claim #14895

Implemented in PR #15025 with complete hermetic regression test coverage (9 tests, zero external dependencies via stdlib sys.modules stubs as requested by maintainer @Git-on-my-level on #14896) and registered in .github/checks-manifest.yaml with all 18 preflight checks passing.

Payment details:

TheRWX avatar Sep 19 '26 18:09 TheRWX

Closing as already fixed on current main.

Dup of closed #14582; merged #14601 already html.escape + urllib.parse.quote in plugins/omi-ms365-app/main.py (#15025 is tests-only)

aryanorastar avatar Sep 20 '26 16:09 aryanorastar