Skip to content

fix(security): CORS allowlist + throttle SSO/SAML routes - #601

Merged
tdrabikdev merged 1 commit into
mainfrom
fix/cors-and-sso-throttle
Jul 12, 2026
Merged

fix(security): CORS allowlist + throttle SSO/SAML routes#601
tdrabikdev merged 1 commit into
mainfrom
fix/cors-and-sso-throttle

Conversation

@tdrabikdev

Copy link
Copy Markdown
Collaborator

OWASP-audit fixes. CORS allowed_origins defaulted to [env('FRONTEND_URL','*')] with supports_credentials=true — a wildcard-with-credentials default. Now an explicit comma-separated allowlist (CORS_ALLOWED_ORIGINSFRONTEND_URL → empty), never *. Throttling: the unauthenticated, crypto-heavy SSO/SAML routes (redirect/callback/login/ACS/SLS) get throttle:30,1 per IP; the static metadata route stays open. New SecurityHardeningTest (CORS never *; SSO route 429s after the limit). Full suite 1153 pass / 1 skip; PHPStan 0-new; Pint clean; no migrations. VERSION 2.0.1-rc.2.

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Security 1 high

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

CORS allowed_origins defaulted to '*' with supports_credentials=true (unsafe
wildcard-with-credentials when FRONTEND_URL is unset). Replace with an explicit
comma-separated allowlist (CORS_ALLOWED_ORIGINS/FRONTEND_URL), never '*'. Also
throttle the unauthenticated, crypto-heavy SSO/SAML routes (redirect/callback/
login/ACS/SLS) at 30/min per IP to blunt DoS.
@tdrabikdev
tdrabikdev force-pushed the fix/cors-and-sso-throttle branch from ade520e to be29a9a Compare July 12, 2026 13:14
@tdrabikdev
tdrabikdev merged commit 98ac675 into main Jul 12, 2026
2 of 7 checks passed
@tdrabikdev
tdrabikdev deleted the fix/cors-and-sso-throttle branch July 12, 2026 13:15
@tdrabikdev tdrabikdev mentioned this pull request Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant