HTTP Request Smuggling via Unsanitized Hop-by-Hop Headers
Pingora forwarded h2c upgrade requests from HTTP/1 to upstream servers, letting later h2c requests on the upgraded connection bypass the proxy's request-level filters. An attacker could use this to evade inspection, though no request smuggling desync was enabled.
Originally disclosed on HackerOne
- Disclosed after 6 months
Summary by the program
Note: the content of the report diverged during the triage process. A more fitting title would be Request Inspection Bypass via Unintended h2c Upgrade Tunneling; there was no request smuggling desync enabled.
Pingora could forward h2c upgrade requests in HTTP/1 to upstream servers, allowing subsequent h2c requests over the upgraded connection to bypass request-level filters applied by the proxy. Pingora 0.9.0 restricts HTTP/1 upgrades to WebSocket by default, addressing this issue. Users with h2c-compatible upstreams should upgrade to that version or later. We thank the researcher for responsibly reporting the issue and verifying the fix.
What the report shows
The target is Cloudflare's Pingora, an HTTP proxy library, and the feature under examination is its handling of HTTP/1 upgrade requests. The report was filed under the title "HTTP Request Smuggling via Unsanitized Hop-by-Hop Headers", but the program's summary states plainly that the content diverged during triage and that a more fitting title would be "Request Inspection Bypass via Unintended h2c Upgrade Tunneling". The program also states that no request smuggling desync was enabled, so the smuggling framing did not survive review.
The behaviour the researcher found is this: Pingora could forward h2c upgrade requests received in HTTP/1 to upstream servers. Once the connection to the upstream was upgraded, subsequent h2c requests sent over that upgraded connection bypassed the request-level filters the proxy applied. In other words, the proxy inspected the first request, allowed the upgrade, and then stopped inspecting what travelled inside the upgraded tunnel.
The fix is in Pingora 0.9.0, which restricts HTTP/1 upgrades to WebSocket by default. The program credits the researcher with responsibly reporting the issue and verifying the fix. The report text itself does not include the individual requests, headers or payloads used to demonstrate the bypass, so there is nothing to reproduce verbatim here.
Root cause
The report does not describe the internal cause beyond Pingora forwarding h2c upgrades to upstreams. When a client asks for an upgrade to a protocol the proxy does not itself terminate, the proxy has two safe options: reject the upgrade, or terminate it and re-originate the inner protocol so that each inner request passes through the same filter chain. Pingora did neither for h2c. It forwarded the upgrade to the upstream, and subsequent h2c requests over the upgraded connection bypassed the proxy's request-level filters.
Pingora 0.9.0 restricts HTTP/1 upgrades to WebSocket by default, addressing the issue. Restricting upgrades to WebSocket by default removes the general case and leaves only the protocol the proxy is designed to tunnel.
Impact
Within the report's own framing, an attacker could use the upgraded connection to send requests that skip the proxy's request-level filters. What those filters enforce is not described, so the practical consequence depends on the deployment: anything the proxy is relied upon to inspect before forwarding, such as access rules or request validation, would not apply to traffic inside the tunnel. The program is explicit that this was an inspection bypass and not a desync, so the impact should not be described as queue poisoning or as corruption of other users' requests.
How this kind of bug works
HTTP/1.1 upgrades are negotiated with hop-by-hop headers. The client sends Connection: Upgrade together with Upgrade: <protocol>, the server agrees with 101 Switching Protocols, and from that point the connection carries the new protocol rather than HTTP/1.1 messages. A proxy in the middle has to decide whether it is a party to that negotiation. If it forwards the headers and then blindly relays bytes, it has effectively created a tunnel it does not understand.
That is the general hazard. Proxies, WAFs and API gateways apply policy per HTTP request. Once a connection is upgraded, there are no more HTTP requests at the outer layer for the policy engine to parse, only an opaque stream. If the inner protocol is itself HTTP (h2c, or HTTP/1.1 carried inside another upgrade), the upstream will happily parse requests that the middlebox never inspected. The same shape appears whenever a proxy passes through a protocol it does not terminate: WebSocket frames, CONNECT tunnels, and upgrade-based protocol switches.
Defences are straightforward in principle. Restrict which upgrade tokens are permitted, ideally to a short allow-list. Terminate permitted upgrades at the proxy and re-originate the inner protocol so that inner requests re-enter the filter chain. Strip or reject hop-by-hop headers that the proxy does not intend to honour, and never forward an upgrade to an upstream unless the proxy is prepared to police what follows.
How to test for it
- Identify endpoints where the target proxies to a backend, especially those that already support WebSocket or other upgrades.
- Send a request with
Connection: Upgradeand anUpgradetoken the application does not obviously need, such as h2c, and observe whether the response is a101passed through from the upstream or a rejection from the edge. - If a
101comes back, send a request inside the upgraded connection that the proxy's filters should block, and compare it with the same request sent as plain HTTP/1.1. A difference in outcome is the signal. - Repeat with other upgrade tokens and with malformed or duplicated hop-by-hop headers to see whether the proxy's parsing of the upgrade differs from the upstream's.
A positive result is a request that the proxy would reject or modify in normal traffic succeeding unchanged inside the tunnel. Common false positives are a 101 generated by the proxy itself rather than the upstream, backends that apply their own equivalent filtering so nothing is actually bypassed, and differences caused by caching or routing rather than by the upgrade. Confirm the bypass by sending the identical request both ways and showing the divergent response.
How it is fixed
Restrict HTTP/1 upgrades to an explicit allow-list, as Pingora 0.9.0 does by limiting them to WebSocket by default. Where an upgrade is permitted, terminate it at the proxy and re-originate the inner protocol so inner requests pass through the same filters. Treat Connection and Upgrade as hop-by-hop headers that are consumed by the proxy rather than forwarded verbatim, and reject upgrade requests to upstreams that are not known to support the requested protocol.
Hunting notes
This class hides wherever a proxy, CDN or gateway sits in front of a backend it does not fully understand: WebSocket endpoints, gRPC and h2c services, streaming APIs, and any route where the edge is documented as inspecting traffic. Recon signals include 101 responses in normal browsing, Upgrade appearing in responses, backends that advertise h2c or HTTP/2 cleartext, and documentation that promises request filtering at the edge.
To get a report accepted, show the filter being bypassed rather than merely showing that an upgrade succeeded. Send the same request through the normal path and through the tunnel, and present both responses side by side. Keep the claim matched to the evidence: an inspection bypass is not a desync, and overstating it invites the kind of retitling this report received.
What happened, in plain words
This report is about Pingora, a piece of software from Cloudflare that acts as an HTTP proxy. A proxy is a middleman: a browser or another program sends its requests to the proxy, and the proxy passes them on to the real server behind it. Because the proxy sits in the middle, it can inspect each request before forwarding it, for example to block requests that break the rules.
The researcher found a way to make Pingora stop inspecting. The trick uses a feature of HTTP called an upgrade. Normally a connection between a client and a server carries ordinary HTTP requests, one after another. An upgrade lets the client ask the server to switch the connection to a different protocol. The client sends a header saying it wants an upgrade and naming the protocol, the server agrees, and from then on the connection carries the new protocol instead of plain HTTP.
The protocol at the centre of this report is h2c, which is HTTP/2 sent over a plain, unencrypted connection. Pingora could take an upgrade request that arrived as HTTP/1 and forward it to the server behind it. Once that connection was upgraded, the requests sent inside it went straight through. The proxy had checked the first request and allowed the upgrade, but it did not check what travelled inside the upgraded connection afterwards.
The report was filed under the title "HTTP Request Smuggling via Unsanitized Hop-by-Hop Headers". The program's summary says the content changed during triage and that a better title would be "Request Inspection Bypass via Unintended h2c Upgrade Tunneling". It also says no request smuggling desync was enabled, so the smuggling framing did not hold up. Request smuggling is a class of attack where a middleman and a server disagree about where one request ends and the next begins, and that is not what happened here.
The issue was fixed in Pingora 0.9.0, which by default only allows HTTP/1 upgrades to WebSocket. The program thanks the researcher for reporting the issue responsibly and for verifying the fix. The report text does not include the individual requests, headers or payloads used to demonstrate the bypass.
Why it happened
The report does not describe the internal cause beyond Pingora forwarding h2c upgrades to upstreams. These two headers are hop-by-hop headers: they concern only the single connection between two parties, not the request as it travels end to end. When a client asks for an upgrade to a protocol the proxy does not itself handle, the proxy has two safe choices. It can refuse the upgrade, or it can take over the upgrade itself and re-create the inner requests on the other side, so that each one passes through the same checks as normal traffic. For h2c, Pingora forwarded the upgrade to the server behind it, and requests sent over the upgraded connection bypassed the proxy's request-level filters.
Pingora 0.9.0 restricts HTTP/1 upgrades to WebSocket by default, addressing the issue. Limiting upgrades to WebSocket by default removes the general case and leaves only the protocol the proxy is built to tunnel.
What the impact was
Within the report's own framing, an attacker could use the upgraded connection to send requests that skip the proxy's request-level filters. The report does not describe what those filters enforce, so the practical effect depends on how the proxy is deployed. Anything the proxy is relied on to check before forwarding, such as access rules or request validation, would not apply to traffic inside the tunnel. The program is explicit that this was an inspection bypass and not a desync, so it should not be described as poisoning a queue or corrupting other users' requests.
In general, how this kind of bug works
HTTP/1.1 upgrades are negotiated with hop-by-hop headers. The client sends Connection: Upgrade together with Upgrade: <protocol>, the server agrees with 101 Switching Protocols, and from that point the connection carries the new protocol rather than HTTP/1.1 messages. A proxy in the middle has to decide whether it is a party to that negotiation. If it forwards the headers and then blindly relays bytes, it has created a tunnel it does not understand.
That is the general hazard. Proxies, web application firewalls and API gateways apply their rules per HTTP request. Once a connection is upgraded, there are no more HTTP requests at the outer layer for the rules engine to read, only an opaque stream of bytes. If the inner protocol is itself HTTP, as with h2c, the server behind the proxy will happily read requests that the middleman never inspected. The same shape appears whenever a proxy passes through a protocol it does not handle itself: WebSocket frames, CONNECT tunnels, and upgrade-based protocol switches.
Defences are simple in principle. Limit which upgrade protocols are allowed, ideally to a short list. Handle permitted upgrades at the proxy and re-create the inner requests so they re-enter the checking chain. Remove or reject hop-by-hop headers the proxy does not intend to honour, and never forward an upgrade to a server unless the proxy is ready to police what follows.
In general, how to test for it
- Find endpoints where the target proxies to a backend, especially those that already support WebSocket or other upgrades.
- Send a request with
Connection: Upgradeand anUpgradeprotocol the application does not obviously need, such as h2c, and watch whether the response is a101passed through from the backend or a rejection from the edge. - If a
101comes back, send a request inside the upgraded connection that the proxy's filters should block, and compare it with the same request sent as plain HTTP/1.1. A difference in outcome is the signal. - Repeat with other upgrade protocols and with malformed or duplicated hop-by-hop headers to see whether the proxy reads the upgrade differently from the backend.
A positive result is a request that the proxy would reject or change in normal traffic succeeding unchanged inside the tunnel. Common false positives are a 101 generated by the proxy itself rather than the backend, backends that apply their own equivalent filtering so nothing is actually bypassed, and differences caused by caching or routing rather than by the upgrade. Confirm the bypass by sending the identical request both ways and showing the different responses.
In general, how it is fixed
Limit HTTP/1 upgrades to an explicit list, as Pingora 0.9.0 does by allowing only WebSocket by default. Where an upgrade is permitted, handle it at the proxy and re-create the inner protocol so inner requests pass through the same filters. Treat Connection and Upgrade as hop-by-hop headers that the proxy consumes rather than forwards word for word, and reject upgrade requests to backends that are not known to support the requested protocol.
In general, where to look
This class of bug hides wherever a proxy, content delivery network or gateway sits in front of a backend it does not fully understand: WebSocket endpoints, gRPC and h2c services, streaming APIs, and any route where the edge is documented as inspecting traffic. Signals worth watching for include 101 responses during normal browsing, Upgrade appearing in responses, backends that advertise h2c or HTTP/2 cleartext, and documentation that promises request filtering at the edge.
To get a report accepted, show the filter being bypassed rather than merely showing that an upgrade succeeded. Send the same request through the normal path and through the tunnel, and present both responses side by side. Keep the claim matched to the evidence: an inspection bypass is not a desync, and overstating it invites the kind of retitling this report received.
Glossary
- Proxy: a middleman server that receives requests and forwards them to the real server behind it, often inspecting them on the way.
- Pingora: Cloudflare's HTTP proxy library, the software this report is about.
- HTTP: the language browsers and servers use to exchange requests and responses.
- HTTP/1 and HTTP/1.1: older versions of HTTP where each request and response is a separate text message on the connection.
- HTTP/2: a newer version of HTTP that packs requests and responses into a binary stream.
- h2c: HTTP/2 sent over a plain, unencrypted connection rather than over TLS.
- Upgrade: an HTTP feature that lets a client ask to switch an existing connection to a different protocol.
Connectionheader: a hop-by-hop header that lists which headers apply only to this one connection.Upgradeheader: the header that names the protocol the client wants to switch to.- Hop-by-hop header: a header that concerns only one link in the chain between client and server, not the whole journey.
101 Switching Protocols: the response a server sends to agree to an upgrade.- Tunnel: a connection that carries raw bytes of another protocol, which the middleman no longer reads as HTTP.
- WebSocket: a protocol for two-way, always-open connections, commonly used for live updates in web pages.
- Request smuggling: an attack where a middleman and a server disagree about where one request ends and the next begins.
- Desync: a state where two parties in a connection are out of step about the stream of messages.
- Request inspection bypass: getting requests past a proxy without the proxy checking them.
- Filter: a rule the proxy applies to each request, such as blocking or validating it.
- WAF (web application firewall): a device or service that inspects web traffic and blocks requests matching attack patterns.
- API gateway: a front door that routes and polices traffic to backend services.
- Backend / upstream: the real server behind the proxy that handles the request.
- CONNECT tunnel: an HTTP method that asks a proxy to open a raw tunnel, typically for encrypted traffic.
- gRPC: a framework for remote procedure calls that commonly runs over HTTP/2.
- Triage: the process of reviewing a bug report, confirming it and deciding its severity.
- Severity: a rating of how serious a bug is, here high.
- Bounty: a payment made to a researcher for a valid report, here 1,500 USD.
- False positive: a finding that looks like a bug but is not one.