-
Notifications
You must be signed in to change notification settings - Fork 835
HTTP/3: upgrade header forwarded #2928
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
Comments
Could this result in request smuggling? Is HTTP/2 also affected? Are any other hop-by-hop headers forwarded that should not be? The following should serve as a workaround: acl hop-by-hop-header { req.fhdr(upgrade) -m found }
http-request deny status 400 if HTTP_3.0 hop-by-hop-header || HTTP_2.0 hop-by-hop-header Also, this should work: http-request deny status 400 if { req.fhdr(upgrade) -m found } !{ req.hdr(connection) -i upgrade } This denies requests with an Alternatively, use HTTP/2 on the backend, but note that this breaks WebSockets if your backend does not support RFC8441 and WebSockets do not fall back to HTTP/1.1. Apache HTTP Server can be made to support RFC8441 but NGINX and Varnish Cache do not support it. |
The upgrade header is only valid accompanied with Connection: Upgrade. Therefore it has no meaning without it and does not deserve any particular processing since Connection is forbidden on H2/H3. |
@wtarreau you are right about that, but it still would be best practice to at least delete hop-by-hop headers, since not doing so violates RFC 9114 & RFC 7230. Here an excerpt from RFC 9114 Section 4.2:
Here an excerpt form RFC 7230 Section 6.7:
semantic-gap vulnerabilities only occur because of HTTP implementations not fully adhering to RFC. although |
I generally agree with being cleaner, I was trying to reassure about the real risks mostly. Upgrade was ressucitated with websocket and totally ignored till then, after that, implementing it was complicated enough that it's more common to see agents just not working than working, so I'm not much worried about the risk that someone would inadvertently upgrade. With that said, on H2 we already clean it AFAIR. And it will happen to h3 as well for free as soon as we've merged the two parsers (which is still on our short-term todo list and that 3 of us have planned to work on tomorrow). It's too difficult, painful and dangerous to maintain an almost exact copy of the parsers in two distinct places and we really want to unify them. |
Detailed Description of the Problem
An HTTP/3 request containing the
upgrade
header is forwarded without modification.The
upgrade
header is not supported in HTTP/3, as RFC 9114 states:This could cause issues, esp. with HTTP/1.1 backend servers.
Expected Behavior
If a client sends an
upgrade
header in a request, it should be either deleted or the request should be considered as malformed and be rejected, since theupgrade
header would influence the backend communication. Rejecting is best practice in my opinion.Steps to Reproduce the Behavior
ugprade
header (curl with HTTP/3 does not support this, use something like aioquic.Do you have any idea what may have caused this?
No response
Do you have an idea how to solve the issue?
No response
What is your configuration?
Output of
haproxy -vv
Last Outputs and Backtraces
Additional Information
No response
The text was updated successfully, but these errors were encountered: