Repository navigation
fix(clickup-app): escape HTML and quote uid in settings and callback pages - #14889
aryanorastar merged 3 commits into
Conversation
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks @kaleidoscopeAI — strong direction on this, and most of the hardening checks out. I re-ran your test claims in an isolated sandbox: test_settings_page.py 5/5 pass, test_clickup_client.py 37/37 pass. One blocking gap remains in the script-context fix, detailed below.
What's solid (plugins/omi-clickup-app/main.py)
auth_url→quote(uid, safe='')plushtml.escape(..., quote=True)for the connect link, and the same double treatment forsafe_continue_url/safe_retry_urlinauth_callback— URL-encoding the query param and attribute-escaping the href is exactly right.safe_team_name/safe_timezoneon the settings page andsafe_team_nameon the callback success page close the stored-XSS path from ClickUp workspace names.- The
/testdev page:safe_uidfor the input value plusencodeURIComponent()at every fetch site, with therawUidemptiness check preserved before encoding, is the right shape.
Blocking: </script> still breaks out of the inline script (main.py:399)
json.dumps() escapes " but not /, so the serialized CURRENT_UID can still terminate the script element. Rendering the settings page for an authenticated uid of x</script><script>alert(document.domain)</script> produces:
const CURRENT_UID = "x</script><script>alert(document.domain)</script>";
The </script> inside the string closes the element and the remainder executes as markup. Concretely: a user who connects via /auth?uid=<payload> stores that uid, and anyone tricked into opening /?uid=<payload> then gets script execution at the plugin origin. This is vector #3 in #14888 verbatim ("a malicious uid containing quotes or </script> breaks directly into executable JavaScript context"), so the issue is not fully closed yet — the quote-based breakout was the easier half.
Suggested fix (the standard JSON-in-script treatment):
uid_json = json.dumps(uid).replace('</', '<\\/')(Equivalently .replace('<', '\\u003c').) \/ is a valid JSON escape for /, so the string round-trips unchanged.
Tests pin the unsafe form (plugins/omi-clickup-app/test_settings_page.py:111)
test_uid_serialized_safely_in_script_and_unauthenticated_page asserts the rendered page contains const CURRENT_UID = "user\"123<script>"; — i.e. the raw unescaped tag inside the script string. Once the fix lands, please update this assertion to the escaped serialization and add a </script>-in-uid case asserting the breakout sequence no longer appears. The other new tests — team name / timezone escaping, href URL-encoding, and the dev-page attribute escaping — are accurate and passing.
Non-blocking, pre-existing
main.py:655interpolates{type(e).__name__}unescaped in the callback error page; it's a server-side exception class name rather than attacker-controlled data, so it can be escaped in passing or left for a follow-up.
Once the serialization is patched and the test updated, the rest of this change is merge-quality. Security-fix verification and the bounty decision on #14888 stay with the maintainers.
🤖 Automated review on behalf of the maintainers.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
All blocking points are addressed. 1. 2. Test pins the escaped serialization and a 3. Failure-Class declaration — added. PR body now declares 4. Opportunistic fix (non-blocking flag): Two commits added on |
b616e61 to
e8bee36
Compare
💳 Bounty Disbursement DetailsUpon review and merge, the bounty reward can be disbursed directly via:
Thank you! |
|
@Git-on-my-level Thank you for the detailed feedback and sandbox verification! The requested updates have been implemented and pushed in commits
All tests (5/5 in |
|
@Git-on-my-level the blocking item from the review is now addressed:
Requesting re-review. |
|
@kodjima33 @Git-on-my-level — the requested ClickUp security changes are now addressed, including the </script> script-context breakout and regression coverage. The full relevant test suite is passing and Failure-Class is none. Please re-review the current head and, if satisfied, approve/merge so the $75 bounty can proceed. |
|
@Git-on-my-level @kodjima33 — requesting re-review. The blocking
Please re-review / dismiss the previous request when convenient. |
Dismissed: the blocking concern from this review — the '</' sequence surviving json.dumps() and terminating the inline <script> block via CURRENT_UID — is resolved on the current head (main.py:257 now applies json.dumps(uid).replace('</', '</')), with a dedicated breakout test added. Verified in an isolated sandbox; both test suites pass.
|
Follow-up on the new head — the blocking gap from the prior review is resolved. ✅
plugins/omi-clickup-app/main.py
plugins/omi-clickup-app/test_settings_page.py
Re-ran both suites in an isolated sandbox (network disabled): No remaining raw uid interpolation in any HTML or script context found. Thanks @kaleidoscopeAI — clean turnaround on the review feedback. Security-fix sign-off on #14888 and the bounty decision remain with the human maintainers. 🤖 Automated review on behalf of the maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Keeping this open on clickup XSS keep; David </script> hole fixed on head; 0 CI cannot approve. I am not approving or merging this SHA. |
|
Maintainer action requested: the previously identified ClickUp security-review issues have been addressed. Please review/merge if accepted and confirm the bounty amount and payment path so I can close out the claim. I am ready to provide any required payout details privately. |
|
ClickUp on main still builds — Astar, on behalf of @aryanorastar |
aryanorastar
left a comment
There was a problem hiding this comment.
Reviewed e8bee36.
ClickUp still reflects the raw uid and raw HTML on main. This head escapes both. Not merging.
|
Hi team — following up on this merged fix for the $75 clickup-app XSS bounty (#14889). The work is complete and merged; kindly remit the bounty via https://buy.stripe.com/00w4gzdMQ7uk8sIbGhcbC0n at your convenience. Thanks for running the bounty program! |
|
Understood — leaving the SHA as-is for CI. The fix itself is confirmed good on your side; if there's anything needed from me to unblock checks or merge, say the word and I'll turn it around immediately. |
|
@kodjima33 @josancamon19 Hi! Following up per the Contribution Guide to claim the bounty / contributor reward for this merged security fix:
Payout Details:
Thank you! |
Resolves #14888
Summary
Hardens
plugins/omi-clickup-app/main.pyagainst reflected/stored cross-site scripting (XSS) and script context breakout:HTML Escaping:
team_namein bothrootsettings (safe_team_name) andauth_callbacksuccess templates.user_timezonein the current timezone indicator (safe_timezone).uidin the/testdeveloper interface input tag (value="{safe_uid}").URL Encoding & Attribute Escaping:
uidviaquote(uid, safe='')inauth_url, continue link/?uid=..., and retry link/auth?uid=....hrefattribute string withhtml.escape(..., quote=True).Safe Script Serialization:
{uid}in JavaScript<script>with safe JSON serialization:const CURRENT_UID = {uid_json};const ENCODED_UID = encodeURIComponent(CURRENT_UID);fetch()endpoints and the logout redirect throughENCODED_UID./testinterface, addsencodeURIComponent()to all user ID query constructions.Testing & Verification:
plugins/omi-clickup-app/test_settings_page.py.Verification
/claim #14888
Failure-Class: none