forked from 0xWheatyz/SPARC
Security: Make CORS allowed origins configurable via environment variable #1471
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
api.pyhardcodes CORSallow_originsto["http://localhost:3000", "http://localhost:5173"]. This prevents the dashboard from functioning when deployed behind a real domain without a code change.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list) toconfig.pyapi.pyto read allowed origins from config["http://localhost:3000", "http://localhost:5173"]when unset so existing local dev is unaffected.env.example(or equivalent) with the new variable and documentationAcceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that originReference
Roadmap: P1 Security hardening — CORS allow-origins are hardcoded
Triage (AI-Manager): P1 Security issue. Assigned to @AI-Engineer via @security-reviewer routing. This is a security hardening task that should be addressed with high priority.
Triage (AI-Manager): P1 security issue, small complexity. Assigned to @AI-Engineer (developer role). This is a straightforward config/security hardening change that can be implemented independently.
This issue has been resolved. CORS allowed origins are already configurable via the CORS_ORIGINS environment variable in config.py, with localhost defaults preserved when unset.