# Request line injection via HTTP/2 in Apache mod_proxy

Apache mod_proxy failed to reject spaces in the HTTP/2 :method pseudo-header, enabling request-line injection when downgrading to HTTP/1.1 to the backend.

- Payout: $1,200
- Severity: medium
- Program: Internet Bug Bounty
- Found by (vendor credit): James Kettle of PortSwigger
- Found by: albinowax
- Disclosed: 2021-11-04
- CVE: CVE-2021-33193
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/1391549
- Library page: https://bugbountylibrary.com/r/h1%3A1391549
- Tags: area:cloud domain:infra impact:integrity kind:bounty platform:hackerone sev:medium tech:nginx technique:chained technique:parser-differential vuln:cache-poisoning vuln:request-smuggling

**Target:** Apache httpd mod_proxy with HTTP/2 enabled
**Root cause:** mod_proxy does not validate the :method pseudo-header for spaces, so it is concatenated verbatim into the HTTP/1.1 request line during downgrade.
**Steps:**
1. Send HTTP/2 request with `:method: GET /anything HTTP/1.1`, `:path: /`, `:authority: psres.net`
2. mod_proxy downgrades and forwards `GET /anything HTTP/1.1 / HTTP/1.1` to backend
3. Backend tolerating trailing junk parses injected request line, bypassing front-end rules
**How found:** Researcher tested HTTP/2 pseudo-header handling in mod_proxy, observing that spaces in :method were not rejected and were reflected into the downgraded request line.
**Exploitation:** Attacker sends crafted HTTP/2 request with spaces in :method; mod_proxy forwards a malformed HTTP/1.1 request line to the backend, allowing bypass of front-end block rules, subfolder escape, protocol downgrade to HTTP/0.9/1.0, and cache poisoning.
**Escalation:** Chaining with cache poisoning and protocol downgrade to reach further attacks.
**Insight:** When a proxy downgrades HTTP/2 to HTTP/1.1, fuzz pseudo-header values (:method, :path, :authority) for characters that are illegal in HTTP/1.1 request lines but not validated by the HTTP/2 layer.

## Proof of concept (copied exactly from the original report)

**HTTP/2 request with space in :method pseudo-header**

```
:method: GET /anything HTTP/1.1
> :path: /
> :authority: psres.net
> Accept-Encoding: gzip, deflate
```

**Injected request line forwarded to backend**

```
GET /anything HTTP/1.1 / HTTP/1.1
> Host:: psres.net
> Accept-Encoding: gzip, deflate
```

