CVE-2022-35948
MEDIUM 5.3CVSS 3.1Nodejs ‘undici’ vulnerable to CRLF Injection via Content-Type
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.
- Published
- 15 Aug 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-74CWE-93
- Also known as
- GHSA-f772-66g8-q5h3
- Sources
- NVDJSONOSV GHSA-f772-66g8-q5h3JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | nodejs | undicicpe:2.3:a:nodejs:undici:*:*:*:*:*:node.js:*:* |
< 5.8.2 | 5.8.2 |
| OSV | npm | undici | < 5.8.2 | 5.8.2 |
References
- https://github.com/nodejs/undici/commit/66165d604fd0aee70a93ed5c44ad4cc2df395f80 · Patch, Third Party Advisory, WEB
- https://github.com/nodejs/undici/releases/tag/v5.8.2 · Release Notes, Third Party Advisory, WEB
- https://github.com/nodejs/undici/security/advisories/GHSA-f772-66g8-q5h3 · Exploit, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-35948 · ADVISORY
- https://github.com/nodejs/undici · PACKAGE
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 15 Aug 2022)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 18 Aug 2022)