forked from 0xWheatyz/SPARC
Security: make CORS allowed origins configurable via environment variable #876
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 CORS allowed origins tolocalhost:3000andlocalhost:5173. This breaks the dashboard when deployed behind a real domain.Roadmap reference: P1 Security hardening
What to do
CORS_ALLOWED_ORIGINSenvironment variable toconfig.py(comma-separated list of origins).api.pyto read allowed origins from config rather than hardcoding.localhost:3000,localhost:5173in development to avoid breaking local dev..env.exampleand README.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comis respected at runtime.api.py.This issue has been resolved. The changes are already merged into main.
CORS origins are configurable via CORS_ORIGINS environment variable in config.py. api.py reads from config.cors_origins instead of hardcoded values.
Closing as completed.