Skip to content

fix(plugins): html-escape reflected OAuth error params in three callback pages - #14503

Merged
kodjima33 merged 2 commits into
BasedHardware:mainfrom
tluangtea-lab:fix/oauth-error-params-escaped
Sep 22, 2026
Merged

kodjima33 merged 2 commits into
BasedHardware:mainfrom
tluangtea-lab:fix/oauth-error-params-escaped

Conversation

@tluangtea-lab

@tluangtea-lab tluangtea-lab commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Escape error / error_description on OAuth callback error pages in omi-dropbox-app, omi-ms365-app, and omi-notion-app using html.escape(..., quote=True).

Verification

  • python3 plugins/test_oauth_error_params_escaped.py — 3 passed.

Failure-Class: new

Review in cubic

@Git-on-my-level

Copy link
Copy Markdown
Member

Verified this locally against the head: checked out the six files, ran python3 plugins/test_oauth_error_params_escaped.py (3 passed), and re-ran it with the three escapes reverted to confirm the suite genuinely fails on a regression (AssertionError: dropbox: script reflected raw) — so the new coverage pins the fix rather than just exercising it.

Per-file notes:

  • plugins/omi-dropbox-app/main.py — auth_callback error page now renders html.escape(error_description or error, quote=True) in the <p>; the or error fallback stays inside the escape. Correct.
  • plugins/omi-ms365-app/main.py — both error and error_description are escaped in the <pre>, with or '' guards that also stop the page from rendering a bare None when only one param is present. Nice detail.
  • plugins/omi-notion-app/main.py — notion_callback escapes error in the .error-box page. This handler only reads error, so no sibling gap is left behind.
  • plugins/test_oauth_error_params_escaped.py — clean hermetic harness (same AST-loader pattern as test_uid_reflection_remaining_apps); no network or exec primitives, asserts both the escaped form and the absence of a raw <script>.
  • .github/checks-manifest.yaml — plugin-oauth-error-params-escaped-tests registers cleanly: valid YAML, unique id, triggers cover all three apps plus the test and the manifest itself.
  • .github/failure-classes/FC-oauth-error-params-reflected-into-html.json — valid schema, id doesn't collide with existing failure classes, and the framing as a sibling of the omi-twitter-app: reflected XSS — /auth/callback error page interpolates the raw state query param into its HTML ($25 bounty proposed) #14350/fix(plugins): encode reflected uid in setup/auth pages across six apps #13658 uid reflections matches the code.

Good catch — these are unauthenticated callback routes reflecting query params straight into HTML, so this is a real reflected-XSS fix, and the change is minimal and correctly scoped. Thank you!

Since this modifies security-sensitive OAuth callback pages, a human maintainer should give the final sign-off before merge.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added security-review Touches auth, provider routing, secrets, or security-sensitive surfaces python labels Sep 18, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified line-by-line: reflected XSS is real on main (error/error_description rendered raw into HTML on unauthenticated OAuth callback routes for dropbox/ms365/notion), fix is a narrow html.escape() on the 3 interpolated strings only — no token/state/credential logic touched. 5/5 confidence, tests included. Author is low-history (0 merged) so diff was verified in full rather than trusted on description.

@tluangtea-lab
tluangtea-lab force-pushed the fix/oauth-error-params-escaped branch from 39e5bad to 9016cc9 Compare September 18, 2026 15:40
@tluangtea-lab

Copy link
Copy Markdown
Contributor Author

Also covers the gcal uid / error sinks described in #14580.

@tluangtea-lab
tluangtea-lab force-pushed the fix/oauth-error-params-escaped branch from 9016cc9 to be5ddd8 Compare September 18, 2026 15:50
@tluangtea-lab

Copy link
Copy Markdown
Contributor Author

Rebased onto main. Extra gcal commit dropped; that work is already upstream. PR is the original three-app escape only.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real reflected XSS confirmed, narrowly scoped, 5/5, but DIRTY -- approve only.

@tluangtea-lab
tluangtea-lab force-pushed the fix/oauth-error-params-escaped branch from fd2c4ca to 0a3dd12 Compare September 20, 2026 11:35

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix(plugins): confidence 5/5 - real reflected-XSS fix (html-escape OAuth error params), narrowly scoped, security-review label. NOT merging: 4 real FAILUREs in statusCheckRollup (Desktop Swift Build & Tests, Detect Desktop Swift Changes, Hygiene, Native Windows process and launcher contracts) -- unrelated to this plugin-only diff but genuine failing checks per hard floor.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Verified on 0a3dd129bffb.

Leaving this open as the remaining-hole vehicle on .github/checks-manifest.yaml, .github/failure-classes/FC-oauth-error-params-reflected-into-html.json, plugins/omi-dropbox-app/main.py, plugins/omi-notion-app/main.py…. remaining hole: OAuth error-param HTML escape in 3 callbacks; CI red.

Not approving from here: hosted checks are not green (0-check / UNSTABLE / FTC). kodjima APPROVE is not a merge. I am not merging.

@tluangtea-lab
tluangtea-lab force-pushed the fix/oauth-error-params-escaped branch from 0a3dd12 to 105e9e4 Compare September 20, 2026 18:20
…ack pages

The OAuth callback error branches of omi-dropbox-app, omi-ms365-app,
and omi-notion-app interpolated the client-controlled error and
error_description query parameters into HTML without escaping, so a
crafted callback URL (e.g. error=<script>alert(1)</script>) is a
reflected-XSS vector on an unauthenticated route. Same class as the
uid reflections fixed in BasedHardware#14350 and PR BasedHardware#13658, via the error fields.

Verification:
- python3 plugins/test_oauth_error_params_escaped.py -> 3 passed
  (hermetic; drives the real auth_callback / notion_callback handlers
  through a hostile error value per app)
- same suite against unpatched main.py files -> dropbox fails at the
  script-reflection assertion (execution stops at the first failure)

Failure-Class: new
@tluangtea-lab
tluangtea-lab force-pushed the fix/oauth-error-params-escaped branch from 105e9e4 to 54753ab Compare September 21, 2026 22:30
@aryanorastar

Copy link
Copy Markdown
Collaborator

The Notion callback on main still has <p>{error}</p>, and Dropbox still interpolates error_description raw. This head escapes both. Desktop Swift is red on faa865f4f8ae, so this stays open and unapproved.

— Astar, on behalf of @aryanorastar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python security-review Touches auth, provider routing, secrets, or security-sensitive surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants