Skip to content

Doc: Add SSRF security warnings to InternetDomainName validation methods#8293

Open
artahir-dev wants to merge 1 commit intogoogle:masterfrom
artahir-dev:docs/internet-domain-name-ssrf-warning
Open

Doc: Add SSRF security warnings to InternetDomainName validation methods#8293
artahir-dev wants to merge 1 commit intogoogle:masterfrom
artahir-dev:docs/internet-domain-name-ssrf-warning

Conversation

@artahir-dev
Copy link

This PR adds explicit security warnings to the Javadoc of InternetDomainName.hasPublicSuffix(), isUnderPublicSuffix(), and isValid(String).

While InternetDomainName correctly documents at the class level that it only performs syntactic analysis, these specific methods are frequently misused as SSRF prevention controls. As demonstrated by recent CVEs in other frameworks (e.g., CVE-2024-22243), syntactic-only validation is insufficient to block SSRF when using wildcard DNS services like nip.io (e.g., 169.254.169.254.nip.io).

Changes included:

  • Added a Security note to hasPublicSuffix(), isUnderPublicSuffix(), and isValid(String) advising against their use as SSRF guards.
  • Included guidance on correctly preventing SSRF by performing post-resolution IP checks.

RELNOTES=n/a

 Syntactic validation in `InternetDomainName` is insufficient for SSRF prevention, as domains like `169.254.169.254.nip.io` are syntactically valid but resolve to sensitive internal IPs. This commit adds a targeted security warning to `hasPublicSuffix()`, `isUnderPublicSuffix()`, and `isValid()` to caution developers against misusing these methods as SSRF guards and recommends post-resolution IP checks instead. RELNOTES=n/a
@chaoren
Copy link
Member

chaoren commented Mar 23, 2026

these specific methods are frequently misused as SSRF prevention controls

Can you show some examples of such usage?

@chaoren chaoren added package=net type=api-docs Change/add API documentation status=triaged P3 no SLO P4 no SLO and removed P3 no SLO labels Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P4 no SLO package=net status=triaged type=api-docs Change/add API documentation

2 participants