Skip to content

fix(plugins): percent-encode reflected uid across the remaining plugin apps - #14502

Merged
kodjima33 merged 4 commits into
BasedHardware:mainfrom
tluangtea-lab:fix/remaining-plugins-uid-encoding
Sep 22, 2026
Merged

kodjima33 merged 4 commits into
BasedHardware:mainfrom
tluangtea-lab:fix/remaining-plugins-uid-encoding

Conversation

@tluangtea-lab

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

Copy link
Copy Markdown
Contributor

Fixes remaining raw uid reflections of the same class as #14350 / #13658 in seven plugin apps (dropbox, google-calendar, hive, ms365, shipbob, shopify, linear).

Percent-encode uid with quote(uid, safe='') at URL sites; html.escape on hidden-input and callback error text.

Verification

  • python3 plugins/test_uid_reflection_remaining_apps.py — 9 passed.
  • Registered plugin-remaining-apps-uid-reflection-tests in .github/checks-manifest.yaml.

Failure-Class: new

Review in cubic

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @tluangtea-lab — verified end to end and this checks out.

What I verified on 007e2a0:

  • All seven apps' encode sites in the diff: dropbox (uid_q in the settings form action, disconnect href, connect href), google-calendar (uid_q for the auth/disconnect/update-calendar URLs, html.escape(..., quote=True) for the hidden uid input and the callback error page), and the quote(uid, safe='') redirect targets in hive, ms365, shipbob, shopify, linear (plus linear's templated oauth_url). All quote uses have resolvable imports at head.
  • Ran plugins/test_uid_reflection_remaining_apps.py in a clean copy: 9/9 pass. The AST import-stub loader keeps the suite hermetic (no network, no disk writes), and the hostile-uid assertions check both attribute breakout (%22) and query injection (%26).
  • The omi-hive-app/test_main.py one-liner is a correct drive-by: find_project_by_name already returns (project, candidates) on main, so the old scalar stub was stale — the tuple stub passes 7/7 (and I reproduced the old stub failing).
  • Remaining raw uid={uid} occurrences in these apps are server-side log lines and urlencode()-wrapped OAuth state params — not reflected markup.
  • Disconnect/setup handlers take required uid: str (or guard if not uid first), so the new quote() calls can't hit a None TypeError that the old raw interpolation silently tolerated.

One non-blocking nit: the suite docstring cites failure class FC-client-param-reflected-into-html-markup, which doesn't exist in .github/failure-classes/ — the class this PR adds is FC-uid-reflected-unencoded-in-remaining-apps. Worth fixing the docstring reference so the registry and tests stay cross-navigable. (Also minor: #14350 is an open issue rather than a merged fix, so "covered omi-twitter-app" slightly overstates it.)

Since this hardens reflected-XSS surfaces across seven OAuth plugin apps, I'd like a maintainer to sign off before merge — the change looks correct and well-tested to me.


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 positive-signal Automation verified a genuine fix/quality contribution 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.

Confidence gate ~4/5: root cause clear (reflected uid XSS, same class as #13658/#14350), scoped repeated pattern across 7 apps + dedicated 269-line hermetic test suite (9 passing per PR body), registered in checks-manifest. Confirmed not already fixed on main (dropbox/main.py etc. still interpolate raw uid). No auth/credential logic touched, only URL/HTML encoding.

@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.

4/5 reflected-uid XSS fix across apps with tests; DIRTY (overlap w/ merged #14581) -- approve only.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open on 5cc3cca94ac0.

remaining-hole uid percent-encode in remaining apps complementary vs #13659; extra production so not CLOSE.

kodjima APPROVE is the size gate, not maintainer merge.

I am not approving or merging this SHA.

@tluangtea-lab
tluangtea-lab force-pushed the fix/remaining-plugins-uid-encoding branch from 5cc3cca to f1cbbc4 Compare September 20, 2026 17:00
omi-bounty-contributor added 2 commits September 21, 2026 08:27
…n apps

Seven plugin apps still reflected the client-controlled uid query
parameter into URLs without encoding: HTML form actions and hrefs
(dropbox, google-calendar), a hidden input value (google-calendar),
and redirect targets (dropbox, hive, linear, ms365, shipbob, shopify).
A uid containing a double quote breaks out of the attribute (reflected
XSS on an unauthenticated page); a bare & or # corrupts the query
handed to the next hop. The same hardening already landed for six apps
in PR BasedHardware#13658 and for omi-twitter-app via BasedHardware#14350; this completes the
sweep for the remaining apps.

Each encoded value is computed once per handler (urllib.parse.quote,
safe=''), and google-calendar's callback error page additionally
HTML-escapes the client-controlled error parameter it renders.

Verification:
- python3 plugins/test_uid_reflection_remaining_apps.py -> 9 passed
  (hermetic: AST-driven per-app import stubbing; drives the real
  handlers - dropbox home connected/unconnected + disconnect, gcal root
  unconnected + disconnect + update-calendar + callback error page,
  hive/ms365/shipbob/shopify/linear disconnect or setup handlers, and
  linear's home template context)
- registered plugin-remaining-apps-uid-reflection-tests in
  .github/checks-manifest.yaml (local + ci lanes)

Failure-Class: new
…dates) contract

find_project_by_name returns (project, candidates) since the
disambiguation work, but test_create_task_success still stubbed the
old single-project return, so the handler raised TypeError on the
unpack and the lane has been red on main for every hive change.

Repair the fixture, restore the lane to green:

- python3 plugins/omi-hive-app/test_main.py -> 7 tests OK
@tluangtea-lab
tluangtea-lab force-pushed the fix/remaining-plugins-uid-encoding branch from f1cbbc4 to dee3990 Compare September 21, 2026 22:14

@aryanorastar aryanorastar 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.

Reviewed current head fd30f82d8d62. origin/main still interpolates raw {uid} in remaining plugin redirects (hive/dropbox/linear/shipbob/shopify). Tests pin percent-encoding. Hygiene SUCCESS. Not merging.

@kodjima33
kodjima33 merged commit ff7490a into BasedHardware:main Sep 22, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

positive-signal Automation verified a genuine fix/quality contribution 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