-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Description
Summary
sirius-api currently falls back to * for CORS origins when CORS_ALLOWED_ORIGINS is unset.
Why this matters
Wildcard CORS in production can expose APIs to unintended browser origins and increase abuse surface.
Evidence
In sirius-api/main.go, when CORS_ALLOWED_ORIGINS is empty, origin fallback is *.
Current behavior
CORS_ALLOWED_ORIGINSmissing ->AllowOrigins = "*"
Expected behavior
- production should fail startup (or fail closed) when allowed origins are not explicitly configured
- no wildcard default in production mode
Proposed fix
- Keep permissive defaults only for local/dev mode if needed.
- In production mode, require non-empty explicit allowlist.
- Validate and normalize configured origins at startup.
- Add tests for missing/invalid/valid origin configurations.
- Document required prod env var usage.
Acceptance criteria
- Production mode does not allow wildcard fallback.
- Startup fails when
CORS_ALLOWED_ORIGINSis missing in production. - CORS tests validate strict allowlist behavior.
- Deployment docs include explicit CORS origin requirements.
Release target
1.0.1 security hardening
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels