fix: block CGNAT range 100.64.0.0/10 in SSRF protection#253
Merged
Conversation
pinodeca
approved these changes
Jun 18, 2026
pinodeca
left a comment
Contributor
There was a problem hiding this comment.
Reviewed with Opus 4.8:
Findings
- Medium — ungated
pg_test:test_ssrf_blocks_cgnat_rangein lib.rs lacks#[cfg(not(feature = "http-allow-all"))], unlike its sibling unit test in ssrf.rs. Underhttp-allow-all, SSRF returnsNoneand this test would fail. - Low — docs: http-security.md §4.1 "Blocked IPv4 ranges" table wasn't updated to list
100.64.0.0/10(RFC 6598).
Add RFC 6598 Carrier-Grade NAT addresses to the IPv4 blocklist. These are used by cloud providers for internal routing and could expose metadata endpoints via DNS rebinding attacks. Also narrow the cfg gate on extract_host to match only the feature flags that actually use it (http-allow-azure-domains, http-allow-test-domains) instead of the overly broad not(http-allow-all).
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.
Split from #221 to ease review.
Add RFC 6598 Carrier-Grade NAT addresses to the IPv4 blocklist. These are used by cloud providers for internal routing and could expose metadata endpoints via DNS rebinding attacks.
Also narrow the
cfggate onextract_hostto match only the feature flags that actually use it (http-allow-azure-domains,http-allow-test-domains) instead of the overly broadnot(http-allow-all).Files:
src/ssrf.rs,src/lib.rsTests: 1 unit test + 1 pg_test