Skip to content

fix: make guarded fetches ignore proxy environment variables - #63

Merged
flthibaud merged 1 commit into
developfrom
fix/ssrf-guard-ignore-proxy
Nov 11, 2026
Merged

flthibaud merged 1 commit into
developfrom
fix/ssrf-guard-ignore-proxy

Conversation

@flthibaud

Copy link
Copy Markdown
Owner

Guard.Transport cloned http.DefaultTransport, which keeps ProxyFromEnvironment. With HTTP_PROXY/HTTPS_PROXY set, the dialer connected to the proxy, so the SSRF guard vetted the proxy's address instead of the target's.

  • t.Proxy = nil: every guarded fetch is a direct dial the guard sees.
  • New test TestTransportDialsTargetNotProxy.
  • README: outbound proxies are not supported.

Tested with gofmt, go vet ./... and go test -race ./... against a migrated postgres:16 (no test skipped).

Closes #46

@flthibaud

Copy link
Copy Markdown
Owner Author

Review: OK to merge.

  • Code, test and README by Mistral, unchanged.
  • This is a behaviour change for anyone who relied on HTTPS_PROXY for feed fetches: those now go direct. Nothing is deployed, so nobody is affected today.
  • Not covered: the browser-impersonating client (tls-client) builds its own transport. I did not check whether it reads proxy variables.

@flthibaud
flthibaud merged commit 1097527 into develop Nov 11, 2026
5 checks passed
@flthibaud
flthibaud deleted the fix/ssrf-guard-ignore-proxy branch November 11, 2026 23:06
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.

SSRF guard checks the proxy instead of the target when HTTP(S)_PROXY is set

1 participant