CVE-2022-35948
nodejs: undici vulnerable to CRLF via content headers
Overview
Description
undici is an HTTP/1.1 client, written from scratch for Node.js.=< undici@5.8.0 users are vulnerable to CRLF Injection on headers when using unsanitized input as request headers, more specifically, inside the content-type header. Example: import { request } from 'undici' 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: 1) http://localhost:3000/ 2) http://localhost:3000/foo2 This issue was patched in Undici v5.8.1. Sanitize input when sending content-type headers using user input as a workaround.
Source: OX vulnerability database
Severity
5.3 · MEDIUM
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- Low
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Weakness: CWE-74, CWE-93
Affected packages · 3
Operating systems · 6 fixes
SUSE Linux Enterprise 1 release · 1 package
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | nodejs16 +3 | 16.17.0-150400.3.6.1 | SUSE-SU-2022:3250-1 |
debian 3 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 12 | node-undici | 5.8.2+dfsg1+~cs18.9.18.1-1 |
| 13 | node-undici | 5.8.2+dfsg1+~cs18.9.18.1-1 |
| 14 | node-undici | 5.8.2+dfsg1+~cs18.9.18.1-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| node-undici | 5.8.2+dfsg1+~cs18.9.18.1-1 |
root.io debian 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 12 | rootio-node-undici | 5.8.2+dfsg1+~cs18.9.18.1-1 |
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2022-35948
- github.com https://github.com/nodejs/undici
- github.com https://github.com/nodejs/undici/commit/66165d604fd0aee70a93ed5c44ad4cc2df395f80
- github.com https://github.com/nodejs/undici/releases/tag/v5.8.2
- github.com https://github.com/nodejs/undici/security/advisories/GHSA-f772-66g8-q5h3
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2022-35948
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2022-35948
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.