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
OAuth HTTP routes set CORSMiddleware(allow_origins="*") on token/register/metadata endpoints | #3563
That wrapper is used for /.well-known/oauth-authorization-server, /token, and (when enabled) /register and /revoke. Wildcard ACAO is intentional for browser-based inspectors, and allow_credentials is not set here (browsers will not attach cookies under the * + credentials rule). Still, token and dynamic-registration endpoints are sensitive: a wildcard makes any future “reflect Origin + credentials” change, or a non-browser client that ignores CORS, easier to misuse.
Suggested change:
Keep * only on public metadata handlers.
For /token, /register, and /revoke, take an explicit allowed_origins list (or reuse TransportSecuritySettings.allowed_origins) and document the Inspector origin as an example allowlist entry.
Add a one-line comment that credentials must stay off while * remains.
Severity: low / configuration clarity and defense-in-depth. Not reported as an exploitable CORS bypass with the current header pair. No proof-of-concept.
Thanks for the review. I'm going to close this as not planned.
The wildcard is deliberate, so that browser-based clients can reach these endpoints. As you note, credentials are off, so no cookies are attached. The endpoints authenticate from what's in the request itself (client credentials, PKCE), so CORS isn't what protects them. The TypeScript SDK's auth handlers do the same.
If you find a way to actually misuse this, please report it through our security policy.
Activity
maxisbey commentedon Oct 6, 2026
Thanks for the review. I'm going to close this as not planned.
The wildcard is deliberate, so that browser-based clients can reach these endpoints. As you note, credentials are off, so no cookies are attached. The endpoints authenticate from what's in the request itself (client credentials, PKCE), so CORS isn't what protects them. The TypeScript SDK's auth handlers do the same.
If you find a way to actually misuse this, please report it through our security policy.
AI Disclaimer
Generated by Claude Code