Repository navigation
Conversation
As we don't report them
Comment on lines
45
to
55
| } else if (!IPValidator.isIP(hostname)) { | ||
| // Skip literal IPs with no pending port: usually inbound IP parsing rather than an outbound request, | ||
| // and we can't tell them apart here. A real outbound one still hits the blocking/SSRF checks below. | ||
| // and we can't tell them apart here. A real outbound one still hits the SSRF checks below. | ||
| HostnamesStore.incrementHits(hostname, 0); | ||
| } | ||
|
|
||
| // Checked here, not at the HTTP client, since not all clients are instrumented and port/context isn't always available. | ||
| if (ServiceConfigStore.shouldBlockOutgoingRequest(hostname)) { | ||
| if (!IPValidator.isIP(hostname) && ServiceConfigStore.shouldBlockOutgoingRequest(hostname)) { | ||
| logger.debug("Blocking DNS lookup for domain: %s", hostname); | ||
| throw BlockedOutboundException.get(); | ||
| } |
There was a problem hiding this comment.
🔵 Low - Bracketed IPv6 URLs remain blocked in outbound lockdown
An application makes an HTTP(S) request to a literal IPv6 URL such as http://[::1]:8080 while new outbound connections are blocked. URLCollector and the DNS advice preserve the bracketed host, but IPValidator.isIP does not accept brackets, so DNSRecordCollector still applies the unknown-host outbound rule and throws BlockedOutboundException. This contradicts the PR's literal-IPv6 exemption and can prevent legitimate direct IPv6 connections from being made.
Show fix
Suggested change
| } else if (!IPValidator.isIP(hostname)) { | |
| // Skip literal IPs with no pending port: usually inbound IP parsing rather than an outbound request, | |
| // and we can't tell them apart here. A real outbound one still hits the blocking/SSRF checks below. | |
| // and we can't tell them apart here. A real outbound one still hits the SSRF checks below. | |
| HostnamesStore.incrementHits(hostname, 0); | |
| } | |
| // Checked here, not at the HTTP client, since not all clients are instrumented and port/context isn't always available. | |
| if (ServiceConfigStore.shouldBlockOutgoingRequest(hostname)) { | |
| if (!IPValidator.isIP(hostname) && ServiceConfigStore.shouldBlockOutgoingRequest(hostname)) { | |
| logger.debug("Blocking DNS lookup for domain: %s", hostname); | |
| throw BlockedOutboundException.get(); | |
| } | |
| } else if (!IPValidator.isIP(hostname) | |
| && !(hostname.startsWith("[") | |
| && hostname.endsWith("]") | |
| && IPValidator.isIP(hostname.substring(1, hostname.length() - 1)))) { | |
| // Skip literal IPs with no pending port: usually inbound IP parsing rather than an outbound request, | |
| // and we can't tell them apart here. A real outbound one still hits the SSRF checks below. | |
| HostnamesStore.incrementHits(hostname, 0); | |
| } | |
| // Checked here, not at the HTTP client, since not all clients are instrumented and port/context isn't always available. | |
| if (!IPValidator.isIP(hostname) | |
| && !(hostname.startsWith("[") | |
| && hostname.endsWith("]") | |
| && IPValidator.isIP(hostname.substring(1, hostname.length() - 1))) | |
| && ServiceConfigStore.shouldBlockOutgoingRequest(hostname)) { | |
| logger.debug("Blocking DNS lookup for domain: %s", hostname); | |
| throw BlockedOutboundException.get(); | |
| } |
More info - Reply on this comment to give feedback or ignore the issue.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
marksmith
approved these changes
Oct 22, 2026
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.
As we don't report them