Skip to content

fix(server): block private IPs on custom proxy and mempoolrpc URLs - #193

Open
SashaMIT wants to merge 1 commit into
flashbots:mainfrom
SashaMIT:fix/validate-proxy-url
Open

fix(server): block private IPs on custom proxy and mempoolrpc URLs#193
SashaMIT wants to merge 1 commit into
flashbots:mainfrom
SashaMIT:fix/validate-proxy-url

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • ?url= intentionally lets users BYO an upstream JSON-RPC proxy, but the target was not validated (scheme / host / resolved IP).
  • That allows SSRF to loopback, link-local (including cloud metadata), RFC1918, and CGNAT, with response bodies reflected to the caller.
  • Validate http/https only + reject blocked resolved addresses before setting the proxy; re-validate redirect hops; apply the same check to mempoolrpc.

Test plan

  • go test ./server/ (includes new ValidateOutboundRPCURL cases + existing handler/url_params tests)
  • Manual: ?url=http://127.0.0.1 / http://169.254.169.254 → 400; public HTTPS proxy still works

Made with Cursor

The intentional ?url= BYO-proxy feature accepted arbitrary http(s)
targets with no host validation, so loopback/link-local/RFC1918/CGNAT
addresses were reachable and response bodies reflected. Validate scheme
and resolved addresses before proxying; re-check redirects; apply the
same gate to mempoolrpc.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
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.

1 participant