fix(http): strict-mode SSRF guard (#4420) and docs (#4423) - #4425
Open
stevenvegt wants to merge 3 commits into
Open
fix(http): strict-mode SSRF guard (#4420) and docs (#4423)#4425stevenvegt wants to merge 3 commits into
stevenvegt wants to merge 3 commits into
Conversation
Fixes potential SSRF vulnerability by preventing the internal http client of connecting to a curated IANA list of prohibited (internal) endpoints/ip ranges. This check is executed at the transport layer just after IP lookup so we don't rely on DNS. An administrator has the config options to allow or deny additional ip ranges. See #4420 for additional info. Assisted-by: AI
Add an SSRF section to the security considerations page explaining the strict-mode outbound guard and how to configure allowedinternalcidrs and deniedcidrs in production. Link to it from the release notes entry. Assisted-by: AI
TestOpenID4VCIConnectionReuse limits connections by mutating http.DefaultTransport at test time. The OpenID4VCI clients now clone client.SafeHttpTransport, which was cloned from http.DefaultTransport at package init, so the limit no longer reached them and the test counted unbounded connections. Set the limit on SafeHttpTransport as well. Assisted-by: AI
Contributor
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (8)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
Dirklectisch
approved these changes
Jul 28, 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.

What
Backport of #4420 (strict-mode SSRF dial guard) and #4423 (deployment documentation) to V5.4.
V5.4 predates the shared
http/clientpackage where the fix lives on master, so this is a port rather than a cherry-pick. The SSRF guard itself (ssrf.go, the IANA prefix lists, allow/deny config handling) is copied unchanged from #4420; the wiring is written against the V5.4 code base:http/clientpackage containing the guard and aSafeHttpTransport: a clone ofhttp.DefaultTransportwith the strict-mode dial guard installed (checked against the resolved IP, so DNS rebinding cannot bypass it, and applied on every connection including redirect hops).vcr/vcr.go), the OpenID4VCI identifier resolver (vcr/openid4vci/identifiers.go), and the OAuth relying party client (auth/services/oauth/relying_party.go, which resolves endpoints from peer DID documents).core.NewStrictHTTPClientnow refuses redirects that downgrade from HTTPS to HTTP in strict mode (reimplementing the standard library's 10-redirect cap, which settingCheckRedirectreplaces).http.client.allowedinternalcidrsandhttp.client.deniedcidrs, wired throughEngine.Configure(invalid CIDRs fail startup). Cloud metadata endpoints are always blocked and cannot be re-admitted via the allowlist.Deliberate deviations from #4420
http.DefaultTransportitself. PKI CRL/denylist fetching, the external crypto storage client, and the internal API clients keep their current behavior, so strict-mode deployments with a private CRL endpoint or an internal secret store are not broken by a patch release. This mirrors master, where those clients are also outside the guarded transport (Route PKI CRL and denylist fetching through the hardened HTTP client #4422).code.dny.dev/ssrftest-only dependency and the IANA drift test are not included. 5.4 is EOL; keeping the prefix lists in sync with the IANA registries happens on 6.2 and master, and list updates can be backported from there if ever needed.Testing
go test ./...passes locally on this branch.http/clientkeeps the behavioral tests from fix(http): block SSRF to non-public addresses in strict mode #4420 (guard blocking, allowlist, denied-over-allowed precedence, metadata blocking, zoned addresses), plus engine-level tests that the config options propagate throughEngine.Configure.