CRLF Injection in Nodejs ‘undici’ via Content-Type
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
undicinpm | < 5.8.2 | 5.8.2 |
Affected products
7- ghsa-coords6 versionspkg:npm/undicipkg:rpm/opensuse/nodejs16&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/nodejs16&distro=openSUSE%20Leap%2015.4pkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP3pkg:rpm/suse/nodejs16&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP4
< 5.8.2+ 5 more
- (no CPE)range: < 5.8.2
- (no CPE)range: < 16.17.0-150300.7.9.1
- (no CPE)range: < 16.17.0-150400.3.6.1
- (no CPE)range: < 16.17.0-8.9.1
- (no CPE)range: < 16.17.0-150300.7.9.1
- (no CPE)range: < 16.17.0-150400.3.6.1
Patches
Vulnerability mechanics
References
5- github.com/advisories/GHSA-f772-66g8-q5h3ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-35948ghsaADVISORY
- github.com/nodejs/undici/commit/66165d604fd0aee70a93ed5c44ad4cc2df395f80ghsaWEB
- github.com/nodejs/undici/releases/tag/v5.8.2ghsaWEB
- github.com/nodejs/undici/security/advisories/GHSA-f772-66g8-q5h3ghsaWEB
News mentions
0No linked articles in our index yet.