Pingora HTTP/2 :authority and Host header mismatch enables cache poisoning and host-based access control bypass
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| Cloudflarehttps://github.com/cloudflare/pingora |
≥ 0.1.0, < 0.9.0→ 0.9.0 |
0.9.0 |
| crates.iopingora-core |
≥ 0.0.0-0, < 0.9.0→ 0.9.0 |
0.9.0 |
Original description The description as published by the source.
Summary
Before version 0.9.0, Pingora accepted HTTP/2 requests whose Host header differed from the :authority pseudo-header. Request filters, cache keys, and logs that read the request URI (session.req_header().uri) saw the :authority value, but the upstream received the client-supplied Host value. Pingora also accepted :authority values containing userinfo (for example, user@example.com). This violates RFC 9113 Section 8.3.1, which requires an intermediary to use the :authority value for Host and replace any existing Host field.
Root cause
HTTP/2 to HTTP/1.1: Host was generated from :authority only when the request had no Host header, so a conflicting client Host was forwarded unchanged.
HTTP/2 to HTTP/2: the client Host header was removed and used to overwrite the upstream :authority, after request filters had already run against the original :authority.
The HTTP/2 server did not compare Host with :authority and did not reject userinfo in the authority.
Impact
A remote, unauthenticated attacker can send a single HTTP/2 request that the application sees as one host and the upstream receives as another. Where request filters, access controls, or cache keys use the URI authority and the upstream routes by Host, this can lead to:
Cache poisoning: a response from another virtual host is stored under the victim host's cache key and served to other users (this also requires the upstream to serve different content per Host).
Host-based ac…
Source: NIST National Vulnerability Database NVD GitHub Advisory
References
- advisory nvd.nist.gov
- advisory github.com
- advisory rustsec.org
- package github.com
- package crates.io
- web github.com
- web github.com
- web github.com