Skip to content

fix: don't DNS-resolve redirect_uris during client registration#488

Open
leifj wants to merge 1 commit into
SUNET:mainfrom
sirosfoundation:fix/redirect-uri-dns-validation
Open

fix: don't DNS-resolve redirect_uris during client registration#488
leifj wants to merge 1 commit into
SUNET:mainfrom
sirosfoundation:fix/redirect-uri-dns-validation

Conversation

@leifj

@leifj leifj commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #487

Problem

The redirect_uri validator resolved hostnames via net.LookupIP() and rejected URIs whose hostnames didn't resolve (for http/https). This caused ccTLD domains like example.se to fail registration while example.org (which resolves to an IANA-reserved IP) succeeded.

Fix

Remove DNS resolution and private-IP blocking from the redirect_uri validator. Redirect URIs are never fetched server-side — they're URLs the browser is redirected to. The SSRF concern that motivated the DNS check doesn't apply.

Keep only the syntactic checks required by RFC 6749 (scheme present, no fragment).

The safe_uri validator (used for server-side fetches like logo_uri) retains its DNS/SSRF checks.

Tests

Added test cases for ccTLD (example.se) and non-resolving hostnames (nonexistent.test).

The redirect_uri validator resolved hostnames via net.LookupIP() and
rejected URIs whose hostnames didn't resolve (for http/https). This
caused ccTLD domains like example.se to fail registration while
example.org (which resolves to an IANA-reserved IP) succeeded.

Redirect URIs are never fetched server-side — they're URLs the browser
is redirected to. The SSRF concern that motivated the DNS check doesn't
apply here. Remove the DNS resolution and private-IP blocking from the
redirect_uri validator, keeping only the syntactic checks required by
RFC 6749 (scheme present, no fragment).

The safe_uri validator (used for server-side fetches like logo_uri)
retains its DNS/SSRF checks.

Add test cases for ccTLD and non-resolving hostnames.
@sonarqubecloud

Copy link
Copy Markdown

@s-jairl s-jairl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

OIDC client registration rejects redirect_uris with non-resolving hostnames

2 participants