Skip to content

Don't leak target options into the proxy connection in forward-proxy mode#494

Open
ericmj wants to merge 1 commit into
mainfrom
unsafe-proxy-opts
Open

Don't leak target options into the proxy connection in forward-proxy mode#494
ericmj wants to merge 1 commit into
mainfrom
unsafe-proxy-opts

Conversation

@ericmj

@ericmj ericmj commented Jul 19, 2026

Copy link
Copy Markdown
Member

Mint.HTTP.connect/4 merged the target connect options with the proxy options and handed the whole set to the connection to the proxy. A target :hostname was therefore used as the proxy connection's hostname — so with an :https proxy, the proxy's certificate got verified against the target's identity — and :transport_opts meant for the target applied to the proxy socket.

Forward-proxy mode now keeps the two option sets separate, like tunnel mode already does: the proxy connection is configured by the options in the :proxy tuple, while the options given to Mint.HTTP.connect/4 describe the target (its :hostname identity and the :proxy_headers).

The new offline tests connect through a local TLS server acting as an :https forward proxy; the two tests that pin the option separation fail against the previous behavior.

…mode

Mint.HTTP.connect/4 merged the target connect options with the proxy
options and handed the whole set to the connection to the proxy. A
target :hostname was therefore used as the proxy connection's hostname,
so with an :https proxy the proxy's certificate was verified against
the target's identity, and :transport_opts meant for the target applied
to the proxy socket.

Forward-proxy mode now keeps the two option sets separate, like tunnel
mode already does: the proxy connection is configured by the options in
the :proxy tuple, while the options given to Mint.HTTP.connect/4
describe the target (its :hostname identity and the :proxy_headers).
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 0

Coverage increased (+0.05%) to 87.599%

Details

  • Coverage increased (+0.05%) from the base build.
  • Patch coverage: 6 of 6 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1637
Covered Lines: 1434
Line Coverage: 87.6%
Coverage Strength: 492.55 hits per line

💛 - Coveralls

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