Skip to content

Java: Improve URI host allowlist checks - #22578

Open
theinfosecguy wants to merge 1 commit into
github:mainfrom
theinfosecguy:java-uri-host-allowlist
Open

theinfosecguy wants to merge 1 commit into
github:mainfrom
theinfosecguy:java-uri-host-allowlist

Conversation

@theinfosecguy

Copy link
Copy Markdown
Contributor

Recognize case-insensitive comparisons of URI.getHost() against constant string allowlist entries, including equality checks through local variables and casts. This reduces false positives in java/ssrf and java/unvalidated-url-redirection.

New matches require actual String comparison methods and preserve the connection between the checked host and the URI. Tests cover reassignment, different URIs, bypassed guards, and untrusted comparison values.

Partially addresses #22259. Stream and helper-based checks remain unresolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant