CVE-2022-31150: CRLF injection in request headers

Published Jul 19, 2022
·
Updated

A flaw was found in the undici package. When requesting an input on an unsanitized request path, method, or headers it is possible to inject Carriage Return/Line Feed (CRLF) sequences into these requests.

Other sources

undici is an HTTP/1.1 client, written from scratch for Node.js. It is possible to inject CRLF sequences into request headers in undici in versions less than 5.7.1. A fix was released in version 5.8.0. Sanitizing all HTTP headers from untrusted sources to eliminate \r\n is a workaround for this issue.

Affected Software

5 affected componentsFixes available
Nodejs Undici Node.js<5.8.0
debian/node-undici<5.8.0+dfsg1+~cs18.9.16-1
5.8.0+dfsg1+~cs18.9.16-1
debian/node-undici<5.8.0+dfsg1+~cs18.9.16-1
5.8.0+dfsg1+~cs18.9.16-1
debian/node-undici<5.8.0+dfsg1+~cs18.9.16-1
5.8.0+dfsg1+~cs18.9.16-1
debian/node-undici
5.15.0+dfsg1+~cs20.10.9.3-1+deb12u45.15.0+dfsg1+~cs20.10.9.3-1+deb12u37.3.0+dfsg1+~cs24.12.11-18.12.2+dfsg+~cs3.2.3-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/node-undici to a version that resolves this vulnerability.

    Fixed in 5.15.0+dfsg1+~cs20.10.9.3-1+deb12u4Fixed in 5.15.0+dfsg1+~cs20.10.9.3-1+deb12u3Fixed in 7.3.0+dfsg1+~cs24.12.11-1Fixed in 8.12.2+dfsg+~cs3.2.3-2
  2. Upgrade

    Upgrade debian/node-undici to a version that resolves this vulnerability.

    Fixed in 5.8.0+dfsg1+~cs18.9.16-1
  3. Upgrade

    Upgrade undici to a version that resolves this vulnerability.

    Fixed in 5.8.0
  4. Compensating control

    Sanitize all HTTP headers from untrusted sources to eliminate CRLF sequences (\r\n), including unsanitized request paths, methods, and headers.

Event History

Jul 19, 2022
CVE Published
12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityWeakness
CVE Published
via MITRE·08:40 PM
Data Sourced
via MITRE·08:40 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·09:15 PM
DescriptionSeverityAffected Software
Jul 21, 2022
Data Sourced
via Red Hat·03:41 AM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is CVE-2022-31150?

CVE-2022-31150 is a vulnerability in the undici package that allows for the injection of CRLF sequences into request headers in undici versions prior to 5.7.1.

2

What is the severity of CVE-2022-31150?

CVE-2022-31150 has a severity level of medium, with a CVSS score of 6.5.

3

How can I fix CVE-2022-31150?

To fix CVE-2022-31150, you should update undici to version 5.8.0 or later.

4

What is undici?

undici is an HTTP/1.1 client library written from scratch for Node.js.

5

Is there a workaround for CVE-2022-31150?

Yes, sanitizing all HTTP headers from untrusted sources to eliminate `\r\n` can be used as a workaround for CVE-2022-31150.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203