Repository navigation
fix(auth): validate Google OAuth token audience - #9214
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9214 +/- ##
=======================================
Coverage 98.96% 98.96%
=======================================
Files 1724 1724
Lines 73823 73879 +56
=======================================
+ Hits 73056 73113 +57
+ Misses 767 766 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Docker builds report
|
There was a problem hiding this comment.
1 issue found across 9 files
Confidence score: 1/5
api/custom_auth/oauth/google.pypasses an access token to an endpoint that requires anid_token, so Google login fails for every configured account. Use the access-token tokeninfo endpoint and compare itsaudiencefield.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="api/custom_auth/oauth/google.py">
<violation number="1" location="api/custom_auth/oauth/google.py:9">
P0: `get_user_info` supplies an OAuth access token, but this endpoint requires an `id_token`, so Google rejects every configured login. Use the access-token tokeninfo endpoint and compare its `audience` field.</violation>
</file>
This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
✅ private-cloud · depot-ubuntu-latest-16 — run #24047 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-arm-16 — run #24047 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #24047 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #24047 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Visual Regression31 screenshots compared. See report for details. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Adds a
GOOGLE_OAUTH_CLIENT_IDsetting, mirroringGITHUB_CLIENT_ID. Google login now checks the access token belongs to this client and the email is verified. Client ID set in the admin-api task definitions; login is inactive until it's set.How did you test this code?
Unit tests (valid token, unset client ID, wrong client, unverified email, API errors) and the existing OAuth audit-log test.