Code review: Critical security and validation gaps in OAuth implementation#592
Closed
Copilot wants to merge 1 commit intofeat/atmn-v2-oauthfrom
Closed
Code review: Critical security and validation gaps in OAuth implementation#592Copilot wants to merge 1 commit intofeat/atmn-v2-oauthfrom
Copilot wants to merge 1 commit intofeat/atmn-v2-oauthfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Copilot
AI
changed the title
[WIP] Add OAuth 2.1 and CLI flow for API key management
Code review: Critical security and validation gaps in OAuth implementation
Jan 19, 2026
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.
Comprehensive security review of PR #570's OAuth 2.1/OpenID implementation and admin role-based auth migration identified critical authorization and input validation gaps.
Critical Security Issues
Missing scope validation in CLI endpoint
/cli/api-keysissues API keys without verifying OAuth token scopes. Any valid token can create keys regardless of granted permissions.Location:
server/src/internal/dev/cli/handlers/handleCreateOAuthApiKeys.tsRequired fix:
Open redirect vulnerability
OAuth callback accepts user-provided
redirect_urifrom Redis state without whitelist validation.Location:
server/src/internal/auth/handlers/handleOAuthCallback.ts:59Required fix: Validate against client's registered URIs before redirecting.
Incomplete admin auth migration
Hardcoded
ADMIN_USER_IDsstill present inserver/src/utils/constants.tsandvite/src/views/admin/hooks/useAdmin.tsxdespite role-based auth migration. Creates privilege escalation path if database role field is compromised.Required action: Remove all hardcoded user ID references; rely solely on
user.rolefield.High Priority Issues
vite/src/views/auth/Consent.tsx:95) rendered without URL scheme validation—could acceptjavascript:URIsEditOAuthClientDialog.tsxuses deprecated@/components/ui/textareainstead of v2 componentsMedium Priority
aria-labelandaria-describedbyassociationsImplementation Strengths
Recommendation
Block merge until scope validation, redirect URI whitelist validation, and hardcoded admin ID removal are complete. Other issues can be addressed in follow-up PRs.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Summary by cubic
Introduces OAuth 2.1 sign‑in and a CLI flow to create and manage API keys. Improves security and simplifies auth while keeping existing keys working for now.
Written for commit bd29694. Summary will update on new commits.