You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bounty proposal] security(whoop-app): unescaped error reflection in OAuth callback and raw uid parameter injection ($75 proposed) #14890
Any attacker can craft a link like https://.../auth/whoop/callback?error=<script>alert(document.cookie)</script> that executes arbitrary JavaScript in the victim's session.
Unescaped Exception Message in Callback Failure:
except Exception as e: return HTMLResponse(content=f"Authentication error: {str(e)}", status_code=500) exposes unescaped exception strings directly in the HTML response.
Unquoted and Unescaped uid URL Parameter Injection:
In root connect page: <a href="{auth_url}"> where auth_url = f"/auth/whoop?uid={uid}" lacks quote(uid, safe='') and attribute escaping.
In root connected page: <a href="/disconnect?uid={uid}"> lacks quote(uid, safe='') and attribute escaping.
In callback success page: <a href="/?uid={uid}"> lacks quote(uid, safe='') and attribute escaping.
In /disconnect: RedirectResponse(url=f"/?uid={uid}") lacks URL parameter encoding.
Fix
Use html.escape for safe_error in both the OAuth error branch and exception fallback.
Guard callback query parameter types against Query object defaults when invoked in tests.
Use quote(uid, safe='') and attribute escaping for all href targets and redirect URLs (safe_auth_url, safe_disconnect_url, safe_continue_url).
Add hermetic test suite in plugins/omi-whoop-app/test_settings_page_encoding.py covering connect URL quoting, disconnect link escaping, reflected callback error escaping, callback success URL quoting, exception message escaping, and redirect quoting (6 tests).
Register whoop-app-settings-encoding-tests and whoop-app-hardening-tests in .github/checks-manifest.yaml.
Verification
All 6 new encoding tests, all 24 test_whoop_hardening.py tests, 4 test_get_workouts.py tests, 3 test_weekly_summary.py tests, and all 53 checks-manifest validation tests pass locally (100% green).
@kodjima33@josancamon19, following the published bounty proposal process, would you approve $75 after review/merge?
Fresh PR rebased onto current main — the original branch could no longer compute mergeability, so its checks never ran: #20399 (CI green, Hygiene success, mergeable).
Fix: escape the OAuth callback error parameter and exception string (reflected XSS), and quote(uid, safe='') across the connect/disconnect/continue links and the /disconnect redirect, with href attribute targets escaped. Tests: 6 hermetic tests, registered as whoop-app-settings-encoding-tests in .github/checks-manifest.yaml. Failure-Class: FC-oauth-error-params-reflected-into-html
@kodjima33@josancamon19, following the published bounty proposal process, would you approve $75 after review/merge?
Activity
kaleidoscopeAI commentedon Sep 19, 2026
Opened PR #14891 with complete fix and regression test suite. Ready for review!
fix(whoop-app): escape callback error and quote uid across OAuth endp…
fix(whoop-app): escape callback error and quote uid across OAuth endp…
kaleidoscopeAI commentedon Oct 3, 2026
Fresh PR rebased onto current main — the original branch could no longer compute mergeability, so its checks never ran: #20399 (CI green, Hygiene success, mergeable).
Fix: escape the OAuth callback
errorparameter and exception string (reflected XSS), andquote(uid, safe='')across the connect/disconnect/continue links and the/disconnectredirect, with href attribute targets escaped.Tests: 6 hermetic tests, registered as
whoop-app-settings-encoding-testsin.github/checks-manifest.yaml.Failure-Class: FC-oauth-error-params-reflected-into-html
@kodjima33 @josancamon19, following the published bounty proposal process, would you approve $75 after review/merge?
undivisible commentedon Oct 22, 2026
Thanks for putting this together. We aren't doing bounties at the moment, so we're closing the bounty proposal issues for now — thanks for the fix! 🙏