# HTTP Request Smuggling via Empty headers separated by CR

llhttp in Node.js accepts bare CR as a header delimiter, so a crafted X-Abc:\rxTransfer-Encoding header is parsed as Transfer-Encoding: chunked, enabling request smuggling through a front-end proxy.

- Payout: $1,800
- Severity: medium
- Program: Internet Bug Bounty
- Found by: yadhukrishnam
- Disclosed: 2023-08-28
- CVE: CVE-2023-30589
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/2032842
- Library page: https://bugbountylibrary.com/r/h1%3A2032842
- Tags: area:web domain:web impact:integrity impact:internal-access kind:bounty platform:hackerone sev:medium tech:nodejs technique:parser-differential vuln:request-smuggling

**Target:** Node.js http module / llhttp parser
**Root cause:** llhttp treats a lone CR (without LF) as sufficient to delimit HTTP header fields, violating RFC7230 which requires CRLF, causing parser disagreement with front-end proxies.
**Steps:**
1. Start the Node.js http server on port 5000 that logs request.headers and body.
2. Send `printf "POST / HTTP/1.1\r\nHost: localhost:5000\r\nX-Abc:\rxTransfer-Encoding: chunked\r\n\r\n1\r\nA\r\n0\r\n\r\n" | nc localhost 5000`.
3. Observe server logs show `x-abc: ''` and `transfer-encoding: chunked`, with body 'A' parsed as chunked.
4. Place a front-end proxy that does not treat bare CR as header terminator in front of Node to smuggle a request.
**How found:** Researcher tested whether llhttp strictly requires CRLF to delimit headers, sent a bare CR inside a header value followed by a fake Transfer-Encoding header, and observed llhttp split it into a separate header while dropping the character after CR.
**Exploitation:** A front-end proxy that does not treat bare CR as a header value terminator forwards the request to a Node.js backend; llhttp reinterprets the embedded `\rxTransfer-Encoding: chunked` as a real Transfer-Encoding header, desynchronizing the two parsers and allowing a smuggled request to be prepended to the next user's request.
**Escalation:** Smuggled requests can bypass front-end access controls and poison the next user's request stream.
**Insight:** Probe HTTP parsers with bare CR, bare LF, and CR-prefixed header names inside header values; any parser that splits on lone CR while a front-end does not creates a smuggling desync. Check parser test suites for missing invalid-input cases like this one.

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

**printf payload with CR-delimited Transfer-Encoding header**

```
printf "POST / HTTP/1.1\r\n"\
             "Host: localhost:5000\r\n"\
             "X-Abc:\rxTransfer-Encoding: chunked\r\n"\
             "\r\n"\
             "1\r\n"\
             "A\r\n"\
             "0\r\n"\
             "\r\n" | nc localhost 5000
```

