Repository navigation
fix(google-calendar-app): escape reflected error and encode uid in setup pages (#14580) - #14581
Merged
Merged
Conversation
…tup pages
Two unauthenticated routes render client-controlled input into HTML with no
encoding.
GET /auth/google/callback takes `error` straight off the query string and
interpolates it into the page body:
<p>{error}</p>
so /auth/google/callback?error=<script>alert(1)</script> executes on the
plugin's origin. No code, state or prior session is needed — the `if error:`
branch is the first thing the handler does.
GET / reflects `uid` into two href attributes and a hidden input value; a uid
of "><script>alert(1)</script> breaks out of the attribute, and a bare & or #
corrupts the query instead.
Follows the encoding pattern of BasedHardware#13658 (six sibling apps) and BasedHardware#14579
(omi-dropbox-app): quote(uid, safe="") for URL contexts, html.escape() for
text and attribute contexts.
Verified:
- plugins/omi-google-calendar-app/test_uid_reflection.py — 5/5 pass on this head
- red→green: 3 of the 5 fail against main's plugin code; the other two are
ordinary-input controls that pass both ways
- registered as gcal-uid-reflection-encoding-tests; manifest parses, 228
checks, no duplicate ids
Failure-Class: none
Co-Authored-By: Claude Opus 5 <[email protected]>
Contributor
Author
|
/claim #14580 PayPal: [email removed] Alternative rail — USDC on Base: |
kodjima33
approved these changes
Sep 18, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Confirmed still-broken on main (raw uid/error interpolated into HTML in root() and google_callback() — no html.escape/quote present). Root cause + linked issue (#14580) + scoped diff + green CI + red→green test proof: 5/5. Merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Two unauthenticated routes on
omi-google-calendar-apprender client-controlled input into HTML with no encoding.1.
GET /auth/google/callback— reflected XSS, no preconditions.errorisQuery(None), taken straight off the URL and interpolated into the page body:So
/auth/google/callback?error=<script>alert(1)</script>executes script on the plugin's origin. Nocode, nostate, no session — theif error:branch is the first thing the handler does, so anyone with the URL can trigger it.2.
GET /—uidreflected into attributes.uidreaches twohrefattributes and a hidden<input ... value="{uid}">. Auidof"><script>alert(1)</script>breaks out of the attribute; a bare&or#silently corrupts the query instead. The disconnected branch renders for anyuidwith no stored tokens, which is every attacker-chosen value.The fix follows the pattern established by #13658 (six sibling apps) and #14579 (
omi-dropbox-app):quote(uid, safe="")for URL contexts,html.escape()for text and attribute contexts. Ordinary input is unchanged —/?uid=abc123still renders/auth/google?uid=abc123, and?error=access_deniedstill showsaccess_denied.Product invariants affected
None. Output encoding only, confined to
plugins/omi-google-calendar-app/; no auth, storage, or tool-contract behaviour changes.How it was verified
plugins/omi-google-calendar-app/test_uid_reflection.py— hermetic, stdlib-only, framework and sibling modules stubbed, driving the realgoogle_callbackandroothandlers:main's plugin code. The other two (test_ordinary_error_still_shown,test_ordinary_uid_still_renders) are controls that pass both ways, so the suite proves the fix rather than restating current behaviour.errorsink, theuidattribute sinks,&/#query corruption, and both ordinary-input controls.gcal-uid-reflection-encoding-tests(triggers onplugins/omi-google-calendar-app/**). Manifest parses, 228 checks, no duplicate ids.scripts/pr-preflight --base upstream/main --pr-body-file <this body>run locally against the branch.Tests
New regression suite
plugins/omi-google-calendar-app/test_uid_reflection.py, registered in the checks manifest so a future edit to this plugin re-runs it. The red→green result is the evidence it would have caught the bug.Failure-Class: none
Fixes #14580