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
Fix wildcard CORS + credentials misconfiguration in FastAPI backend #1
Summary
The backend currently allows requests from any origin while also allowing credentials, which is an unsafe CORS configuration for a service that has cookie-based authentication elsewhere in the stack. This issue replaces the wildcard origin with an explicit, environment-driven allowlist.
Why this matters
main.py sets allow_origins=["*"] together with allow_credentials=True. Wildcard origin combined with credentialed requests is a configuration most security tooling flags outright, and the stack has Clerk cookie-based auth elsewhere in the frontend. This means credentialed cross-origin requests may currently be reachable from any origin. This is a live, production-facing security gap and should be the first fix made to the repository.
Acceptance Criteria
allow_origins reads from an explicit env-driven allowlist (CORS_ORIGINS, already defined in .env.example but unused in code) instead of "*"
allow_credentials=True only applies to the allowlisted origins
A regression test or manual curl script confirms a non-allowlisted Origin header does not receive Access-Control-Allow-Origin in the response
Local dev (localhost:3000) and the deployed Vercel origin both continue to work without errors
"Hi @aadityat23, I would love to tackle this for my first issue here. I will replace the wildcard origin in main.py by pulling CORS_ORIGINS from the environment variables, ensuring that credentialed requests are strictly allow listed. Could you assign this to me?"
Thanks for your interest @bheemrzz07-bit ! I've assigned this issue to you.
Please create a new branch, implement the changes according to the acceptance criteria, and open a PR when it's ready.
Include a brief summary of what you changed and how you tested it.
If you have any questions while working on it, feel free to ask. Good luck!
Activity
bheemrzz07-bit commentedon Jul 24, 2026
"Hi @aadityat23, I would love to tackle this for my first issue here. I will replace the wildcard origin in main.py by pulling CORS_ORIGINS from the environment variables, ensuring that credentialed requests are strictly allow listed. Could you assign this to me?"
aadityat23 commentedon Jul 24, 2026
Thanks for your interest @bheemrzz07-bit ! I've assigned this issue to you.
Please create a new branch, implement the changes according to the acceptance criteria, and open a PR when it's ready.
Include a brief summary of what you changed and how you tested it.
If you have any questions while working on it, feel free to ask. Good luck!
aadityat23 commentedon Jul 24, 2026
Fixed in PR #45. Thanks @bheemrzz07-bit for the contribution and for addressing the review feedback! 🚀