Skip to content

Fix cross-host routing on keep-alive plain proxy connections - #719

Merged
haga-rak merged 1 commit into
mainfrom
fix-plain-proxy-per-request-authority
Jul 2, 2026
Merged

haga-rak merged 1 commit into
mainfrom
fix-plain-proxy-per-request-authority

Conversation

@haga-rak

@haga-rak haga-rak commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Fixes the cross-host contamination reported on 1.39.6-alpha: a feed fetch could receive and persist the body of an unrelated site, and strict origins rejected misdirected requests with 421.

On a keep-alive plain HTTP proxy connection, Http11DownStreamPipe stamped every request after the first with the connection level authority, parsed from the first request only. A request for host B was then routed through host A's connection pool while carrying Host: B. Permissive origins answer that with their default vhost content, strict ones with 421 Misdirected Request.

The plain forward and reverse proxy providers now enable per-request authority resolution on the pipe, using the same absolute-form URI or Host fallback logic as the first request, factored into AuthorityUtility.TryParsePlainRequestAuthority. Tunneled connections (CONNECT, SOCKS5) keep the connection level authority since their destination is fixed by the tunnel.

Includes a regression test driving three absolute-form requests alternating between two local origins over a single keep-alive client connection; it fails on the previous code.

Http11DownStreamPipe stamped every request after the first with the
connection level authority, so a request for host B could go out over
a connection to host A (wrong body from permissive origins, 421 from
strict ones). Plain forward and reverse proxy pipes now resolve the
authority from each request, tunneled connections keep the fixed one.
@haga-rak

haga-rak commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

#720

@haga-rak
haga-rak merged commit 02c90af into main Jul 2, 2026
2 checks passed
@haga-rak haga-rak added the bug Something isn't working label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant