Skip to content

reject non-routable addresses in HttpClient to prevent SSRF via AIA - #364

Open
itecz26 wants to merge 2 commits into
ebourg:masterfrom
itecz26:httpclient-ssrf-guard
Open

itecz26 wants to merge 2 commits into
ebourg:masterfrom
itecz26:httpclient-ssrf-guard

Conversation

@itecz26

@itecz26 itecz26 commented Sep 29, 2026 •

Copy link
Copy Markdown

reject loopback/link-local/wildcard/multicast targets in HttpClient.connect before opening the connection (and on every redirect), so an untrusted certificate's AIA caIssuers url, fetched while CertificateChain.complete() completes the chain during verification, can't be used to reach the local host or the cloud metadata endpoint. private ranges (10.x, 172.16.x, 192.168.x) stay reachable so a private CA serving its AIA urls from there keeps working.

@ebourg

ebourg commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Thank you for the PR. What if a private CA uses AIA URLs on a private network (10.x.x.x, 192.168.x.x) ?

@itecz26

itecz26 commented Sep 29, 2026

Copy link
Copy Markdown
Author

good point, blocking the whole private range would break a private CA serving its AIA urls from 10.x or 192.168.x. i've dropped the site-local check and kept only loopback, link-local (covers the 169.254.169.254 metadata endpoint), wildcard and multicast, so private networks stay reachable and the untrusted-cert case can't reach the local host or metadata service. dropped the 10.0.0.1 case from the test to match.

@itecz26

itecz26 commented Oct 23, 2026

Copy link
Copy Markdown
Author

any update?

@ebourg

ebourg commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Not yet, sorry, but I'll get a look

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants