Repository navigation
Conversation
… information leakage Failure-Class: none
…tion Failure-Class: none
Failure-Class: none
Failure-Class: none
|
Keeping this open on 1e894b8. oauth.py on main still returns Invalid Firebase ID token: {e}. This head also changes enable_app and pinned-URL joining. Not one defect. Not approving this SHA. — Astar, on behalf of @aryanorastar |
|
@aryanorastar @Git-on-my-level — updated for re-review. Your previous review was on Current HEAD
Zero |
|
Thanks @Mateidslx — verified on the rebased head Scope confirmed. Diffing
One non-blocking consideration: unauthenticated callers can drive
Auth error-response behavior (and the bounty claim in the description) need maintainer sign-off before merge. 🤖 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 |
Moved to backend/tests/unit/
… masking Failure-Class: none Bounty proposal: $50
|
@Git-on-my-level @aryanorastar — updated addressing the test feedback:
Ready for re-review. |
Production raises detail="Error verifying Firebase ID token. Please re-authenticate." Update test to match the exact static message. Failure-Class: none
CI Fix AppliedTest Root cause: Production code raises Fix: Updated test assertion to match the exact production message. The security property is preserved - the test still verifies that |
aryanorastar
left a comment
There was a problem hiding this comment.
Firebase token errors still return Invalid Firebase ID token: {e} and Error verifying Firebase ID token: {e}. This head raises static 401 details. test_oauth_firebase_error_sanitization.py calls oauth_token. Checks passed on 3646003bcb69.
|
Hi team! 👋 |
|
Follow-up review on 3646003 (prior verification was on the earlier head b80887f): The production change in backend/routers/oauth.py is unchanged since the verified head — still exactly the two exception handlers in oauth_token (lines 187-192): raw {e} interpolation removed from both 401 detail strings, with the internal details preserved server-side via logger.warning / logger.error. Confirmed main still carries the leaky handlers, so this fix remains needed. The newer commits only touch the test side and address the earlier feedback in backend/tests/unit/test_oauth_firebase_error_sanitization.py:
Backend CI is green across the suite. Label updates: removing needs-tests (router-seam coverage now exists); keeping security-review since this is an auth error path — @aryanorastar's approval on this head is noted, and the merge call stays with the maintainers. — automated review on behalf of the Omi maintainers by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Verified on the current head (3646003):
Two tiny non-blocking nits: the test file imports AsyncMock but never uses it, and the PR description references an older test path (backend/routers/tests/test_oauth_token_sanitization.py) and the endpoint as /v1/oauth/exchange — the actual file is backend/tests/unit/test_oauth_firebase_error_sanitization.py and the route is /v1/oauth/token. Neither blocks merge. Good security hygiene — thanks for the clean, narrowly-scoped fix and the solid tests. Already approved by @aryanorastar; leaving the merge call with the maintainers. Feedback generated by automated maintainer review on behalf of the Omi maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Closing per the maintainer's bounty-policy ruling (2026-10-01) — the valuable fix in this PR (Firebase ID token verification error reflection on the OAuth token endpoint) has been cherry-picked and re-landed with full credit at #20168. The regression tests land there too, so this PR is superseded rather than merged. Thanks for the good work on this one — the identification of the leak and the tests were solid. The bounty proposal (#16028) is declined; the fix ships regardless. by AI on behalf of David — if you need David's attention urgently, please @Git-on-my-level and escalate with |
|
Hey @Mateidslx 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
…ponses (#20168) What: `POST /v1/oauth/token` reflected raw Firebase verification exceptions (`InvalidIdTokenError` details, cert fetch URLs, key IDs, claim state) directly into HTTP 401 response bodies. Unauthenticated surface: any caller can submit a malformed token and read internal verification traces. Why: Internal error-detail leakage on an auth endpoint; real (if minor) security hygiene issue, not template hardening against impossible inputs. Risk: Low — error *bodies* become static strings; status codes unchanged; detail preserved in server logs. Solution: Log exception detail server-side (`logger.warning` / `logger.error`), return static 401 messages. Regression tests assert the leak strings no longer appear in the raised HTTPException. Cherry-picked from #16029 by @Mateidslx (code + regression tests as authored; verified the leak still exists on current `main` before re-landing). Original bounty proposal #16028 is declined per the maintainer's standing bounty-policy ruling; the fix lands here with credit. Verification evidence: - `backend/.venv/bin/python -m pytest tests/unit/test_oauth_firebase_error_sanitization.py` — 2 passed (both tests fail on unpatched `main` code, pass with this diff) - `scripts/pr-preflight --pr-body-file` passes with the citations below Invariants: INV-DATA-1 Failure-Class: none --- *by AI on behalf of David — if you need David's attention urgently, please @Git-on-my-level and escalate with `need human response`.* <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/20168?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
…ponses The oauth_token exchange endpoint reflected raw Firebase verification exceptions (InvalidIdTokenError details, cert fetch URLs, key IDs, claim state) directly into HTTP 401 response bodies. Moves the detail to server-side logging (warning/error) and returns static messages. Cherry-picked from BasedHardware#16029 by @Mateidslx (code + regression tests as authored there; verified against current main — the leak is still present). Original bounty proposal BasedHardware#16028 declined; this lands the fix under the maintainer account instead. Verification: backend/.venv pytest tests/unit/test_oauth_firebase_error_sanitization.py — 2 passed. Failure-Class: none
Summary
Lines 188 & 190 in
backend/routers/oauth.pyexpose raw internal Firebase Authentication errors ({e}) directly in HTTP 401 response payloads during the OAuth exchange flow. This leaks sensitive internal authentication architecture details, including Google API connection timeouts, certificate verification traces, and token validation internal states to untrusted clients.Vulnerability Detail
Affected endpoint:
POST /v1/oauth/exchangeFix
logger.warning/logger.errorbackend/routers/tests/test_oauth_token_sanitization.pyChecklist
Failure-Class: none
Line-Count-Exception: backend/routers/oauth.py | 275 -> 277 | mask Firebase ID token internal error leakage