Skip to content

fix(security): guard OIDC discovery against SSRF - #600

Merged
tdrabikdev merged 1 commit into
mainfrom
fix/ssrf-oidc-guard
Jul 12, 2026
Merged

fix(security): guard OIDC discovery against SSRF#600
tdrabikdev merged 1 commit into
mainfrom
fix/ssrf-oidc-guard

Conversation

@tdrabikdev

Copy link
Copy Markdown
Collaborator

OWASP-audit fix (HIGH). OidcClient fetched the admin-configured issuer_url + every discovery-advertised endpoint (token/jwks/userinfo) with no host restriction — SSRF to cloud metadata / localhost / internal network, and the token_endpoint receives the client_secret. New App\Support\SsrfGuard::assertPublicHttps (https-only; blocks localhost + private/reserved IP literals + hosts resolving to non-public) called before each outbound fetch. Unresolvable hosts are allowed (no reachable target; keeps tests off live DNS). New SsrfGuardTest; existing OIDC tests green. Full suite 1153 pass / 1 skip; PHPStan 0-new; Pint clean; no migrations. VERSION 2.0.1-rc.1.

OidcClient fetched the admin-configured issuer_url and the endpoints its
discovery doc advertises (token/jwks/userinfo) with no host restriction — an
admin could target cloud metadata / localhost / the internal network, and the
token_endpoint receives the client_secret. Add SsrfGuard::assertPublicHttps
(https-only; blocks localhost, private/reserved IP literals, and hosts that
resolve to a non-public address) before each outbound fetch.
@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 14 complexity · 0 duplication

Metric Results
Complexity 14
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.

@tdrabikdev
tdrabikdev merged commit cdb0f49 into main Jul 12, 2026
3 of 9 checks passed
@tdrabikdev
tdrabikdev deleted the fix/ssrf-oidc-guard branch July 12, 2026 13:14
@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