Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider impact of proxy-initiated close on HTTP 407 #2942

Closed
bemasc opened this issue Nov 7, 2024 · 2 comments · Fixed by #2997
Closed

Consider impact of proxy-initiated close on HTTP 407 #2942

bemasc opened this issue Nov 7, 2024 · 2 comments · Fixed by #2997
Labels
optimistic-upgrade draft-ietf-httpbis-optimistic-upgrade

Comments

@bemasc
Copy link
Contributor

bemasc commented Nov 7, 2024

@ekinnear noted today that the performance impact of proxies closing the connection after returning HTTP 407 are not merely hypothetical, and are significant in practice. This draft currently says that proxies MAY adopt this behavior as a mitigation for potential misbehaving clients.

Some things we could do:

  • Remove this MAY. After a closer look at some earlier anecdotes, we have not actually found a client that exhibits the misbehavior.
  • Conduct some kind of study or outreach to see if we can find any misbehaving clients (i.e. CONNECT clients that send first-flight payload data without waiting for the 200 response).
  • Define a request header like "Vulnerable-To-Request-Smuggling: ?0", by which the client promises that it is proxying TCP connections for a trusted TCP client or delaying payload data until after the success response, so there is no need for defensive measures.
@bemasc bemasc added the optimistic-upgrade draft-ietf-httpbis-optimistic-upgrade label Nov 7, 2024
@MikeBishop
Copy link
Contributor

Definitely not the last one -- too close to the Evil Bit. I'd be inclined to leave this as MAY, but not stronger, and expand on the text a little bit. It's a defense that has a performance cost, and implementers need to decide whether they're willing to pay the price to have that defense. That's what MAY is -- we don't endorse it, we just note the option.

The right solution is to use HTTP/2 or HTTP/3, where this won't be an issue.

@bemasc
Copy link
Contributor Author

bemasc commented Feb 11, 2025

By trolling through Github, I was able to find many examples of proxy clients that appear to have the wrong behavior:

Most of these are not an "early send" optimization as I expected. Instead, most of them wait for the response but assume a "200 OK" without checking the status code.

These clients might all be intended to be used in contexts where this behavior doesn't create a vulnerability, but it does seem to suggest that there is an easy mistake here that justifies the MAY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimistic-upgrade draft-ietf-httpbis-optimistic-upgrade
Development

Successfully merging a pull request may close this issue.

2 participants