fix(security): CORS allowlist + throttle SSO/SAML routes - #601
Merged
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 1 high |
🟢 Metrics 4 complexity · 0 duplication
Metric Results Complexity 4 Duplication 0
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
force-pushed
the
fix/cors-and-sso-throttle
branch
from
July 12, 2026 13:14
ade520e to
be29a9a
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OWASP-audit fixes. CORS
allowed_originsdefaulted to[env('FRONTEND_URL','*')]withsupports_credentials=true— a wildcard-with-credentials default. Now an explicit comma-separated allowlist (CORS_ALLOWED_ORIGINS→FRONTEND_URL→ empty), never*. Throttling: the unauthenticated, crypto-heavy SSO/SAML routes (redirect/callback/login/ACS/SLS) getthrottle:30,1per IP; the static metadata route stays open. NewSecurityHardeningTest(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.