Every CVE Search/ Get API key

CVE-2022-35948

CRLF Injection in Nodejs ‘undici’ via Content-Type

5.3 MediumFix available

undici is an HTTP/1.1 client, written from scratch for Node.js.=< [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: 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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
Low
Availability
None

Exploit likelihood

1.39%Up 0.5 points since Aug 14, 2022
90%50%10%1%

What each source reports

CVE List Score used 5.3

CRLF Injection in Nodejs ‘undici’ via Content-Type

undici is an HTTP/1.1 client, written from scratch for Node.js.=< [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: 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.

Record
CVE-2022-35948
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-93, CWE-74
Updated
2026-11-02
EUVDEUVD-2022-6547 5.3

undici is an HTTP/1.1 client, written from scratch for Node.js.=< [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: 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.

Record
EUVD-2022-6547
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-f772-66g8-q5h3 5.3

Nodejs ‘undici’ vulnerable to CRLF Injection via Content-Type

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:

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

Patches

This issue was patched in Undici v5.8.1

Workarounds

Sanitize input when sending content-type headers using user input.

For more information

If you have any questions or comments about this advisory:

Record
GHSA-f772-66g8-q5h3
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-74, CWE-93
Updated
2026-11-02
NVD 5.3

undici is an HTTP/1.1 client, written from scratch for Node.js.=< [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: 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.

Record
CVE-2022-35948
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-74, CWE-93
Updated
2026-11-02
OSV 5.3

CRLF Injection in Nodejs ‘undici’ via Content-Type

undici is an HTTP/1.1 client, written from scratch for Node.js.=< [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: 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.

Record
CVE-2022-35948
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-74, CWE-93
Updated
2026-11-02
OSVDEBIAN-CVE-2022-35948 5.3

undici is an HTTP/1.1 client, written from scratch for Node.js.=< [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: 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.

Record
DEBIAN-CVE-2022-35948
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Updated
2026-11-03
Show 5 moreShow less
OSVGHSA-f772-66g8-q5h3 5.3

Nodejs ‘undici’ vulnerable to CRLF Injection via Content-Type

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:

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

Patches

This issue was patched in Undici v5.8.1

Workarounds

Sanitize input when sending content-type headers using user input.

For more information

If you have any questions or comments about this advisory:

Record
GHSA-f772-66g8-q5h3
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-74, CWE-93
Updated
2026-11-02
OSVCLSA-2026-1788560495 No score

TuxCare security update for undici (14 CVEs)

TuxCare rebuilt undici to address 14 CVEs. Fixed in 5.5.1-tuxcare.1.

Record
CLSA-2026-1788560495
Updated
2026-11-02
OSVSUSE-SU-2022:3196-1 No score

Security update for nodejs16

This update for nodejs16 fixes the following issues:

  • CVE-2022-35949: Fixed SSRF when an application takes in user input into the path/pathname option of undici.request (bsc#1202382).
  • CVE-2022-35948: Fixed CRLF injection via Content-Type (bsc#1202383).
  • CVE-2022-29244: Fixed npm pack ignores root-level .gitignore and .npmignore file exclusion directives when run in a workspace (bsc#1200517).
  • CVE-2022-31150: Fixed CRLF injection in node-undici (bsc#1201710).

Bugfixes:

  • Enable crypto-policies for SLE15 SP4+ and TW (bsc#1200303)
Record
SUSE-SU-2022:3196-1
Updated
2026-11-02
OSVSUSE-SU-2022:3250-1 No score

Security update for nodejs16

This update for nodejs16 fixes the following issues:

  • CVE-2022-35949: Fixed SSRF when an application takes in user input into the path/pathname option of undici.request (bsc#1202382).
  • CVE-2022-35948: Fixed CRLF injection via Content-Type (bsc#1202383).
  • CVE-2022-29244: Fixed npm pack ignores root-level .gitignore and .npmignore file exclusion directives when run in a workspace (bsc#1200517).
  • CVE-2022-31150: Fixed CRLF injection in node-undici (bsc#1201710).

Bugfixes:

  • Enable crypto-policies for SLE15 SP4+ and TW (bsc#1200303)
Record
SUSE-SU-2022:3250-1
Updated
2026-11-02
OSVSUSE-SU-2022:3251-1 No score

Security update for nodejs16

This update for nodejs16 fixes the following issues:

  • CVE-2022-35949: Fixed SSRF when an application takes in user input into the path/pathname option of undici.request (bsc#1202382).
  • CVE-2022-35948: Fixed CRLF injection via Content-Type (bsc#1202383).
  • CVE-2022-29244: Fixed npm pack ignores root-level .gitignore and .npmignore file exclusion directives when run in a workspace (bsc#1200517).
  • CVE-2022-31150: Fixed CRLF injection in node-undici (bsc#1201710).

Bugfixes:

  • Enable crypto-policies for SLE15 SP4+ and TW (bsc#1200303)
Record
SUSE-SU-2022:3251-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
undici
npm
through 5.8.1
5.8.2
undici
TuxCare:npm
5.5.1-tuxcare.0 up to 5.5.1-tuxcare.1, plus listed versions
5.5.1
5.5.1-tuxcare.1
node-undici
Debian:12
before 5.8.2+dfsg1+~cs18.9.18.1-1
5.8.2+dfsg1+~cs18.9.18.1-1
node-undici
Debian:13
before 5.8.2+dfsg1+~cs18.9.18.1-1
5.8.2+dfsg1+~cs18.9.18.1-1
node-undici
Debian:14
before 5.8.2+dfsg1+~cs18.9.18.1-1
5.8.2+dfsg1+~cs18.9.18.1-1
undici
npm
before 5.8.2
5.8.2
nodejs16
SUSE:Linux Enterprise Module for Web and Scripting 12
before 16.17.0-8.9.1
16.17.0-8.9.1
nodejs16
SUSE:Linux Enterprise Module for Web and Scripting 15 SP4
before 16.17.0-150400.3.6.1
16.17.0-150400.3.6.1
nodejs16
openSUSE:Leap 15.4
before 16.17.0-150400.3.6.1
16.17.0-150400.3.6.1
nodejs16
SUSE:Linux Enterprise Module for Web and Scripting 15 SP3
before 16.17.0-150300.7.9.1
16.17.0-150300.7.9.1
nodejs16
openSUSE:Leap 15.3
before 16.17.0-150300.7.9.1
16.17.0-150300.7.9.1

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-35948 is a medium vulnerability (CVSS 5.3) in Nodejs Undici, published August 13, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.39%, the 72nd percentile. Fixed in undici 5.8.2.

References

Show 14 moreShow less
MoveEnter Open