Skip to content
OpenAdvisories
Medium · 5.3 CVE-2022-35948 EUVD-2022-6547GHSA-f772-66g8-q5h3

CRLF Injection in Nodejs ‘undici’ via Content-Type

Published Aug 13, 2022 · Updated Apr 22, 2025 · Assigned by GitHub_M

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.

Affected products

VendorProductAffectedFixed
nodejs undici =< 5.8.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 node-undici 5.8.2+dfsg1+~cs18.9.18.1-1 —
Debian 13 node-undici 5.8.2+dfsg1+~cs18.9.18.1-1 —
Debian 12 node-undici 5.8.2+dfsg1+~cs18.9.18.1-1 —
ReleasePackageFixed inAdvisory
SLES 15 SP4 nodejs16 16.17.0-150400.3.6.1 SUSE-SU-2022:3250-1
SLES 15 SP3 nodejs16 16.17.0-150300.7.9.1 SUSE-SU-2022:3251-1
SLES 12 nodejs16 16.17.0-8.9.1 SUSE-SU-2022:3196-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.4 nodejs16 16.17.0-150400.3.6.1 SUSE-SU-2022:3250-1
openSUSE Leap 15.3 nodejs16 16.17.0-150300.7.9.1 SUSE-SU-2022:3251-1

Affected packages

EcosystemPackageAffectedFixedRecord
npm undici < 5.8.2 5.8.2 GHSA-f772-66g8-q5h3

Advisories 6

References