5.3medium
CRLF injection in request headers
- Severity
- 5.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.52% (higher than 75% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-3cvr-822r-rqcc
Description
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
| Product or package | Versions | Reported by |
|---|---|---|
| nodejs undici | < v5.7.1, >= v5.8.0, before 5.8.0 | CVE List, NVD |
| undici (npm) | before 5.8.0 | GitHub Advisory Database |
All scores
| GitHub_M | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Impact
It is possible to inject CRLF sequences into request headers in Undici.
const undici = require('undici')
const response = undici.request("http://127.0.0.1:1000", {
headers: {'a': "\r\nb"}
})
The same applies to path and method
Patches
Update to v5.8.0
Workarounds
Sanitize all HTTP headers from untrusted sources to eliminate \r\n.
References
https://hackerone.com/reports/409943 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-12116
For more information
If you have any questions or comments about this advisory:
- Open an issue in undici repository
- To make a report, follow the SECURITY document
NVD (es)
undici es un cliente HTTP/1.1, escrito desde cero para Node.js. Es posible inyectar secuencias de tipo CRLF en los encabezados de las peticiones en undici en versiones anteriores a 5.7.1. En versión 5.8.0 ha sido publicada una corrección. Una corrección a este problema es sanear todas las cabeceras HTTP de fuentes no confiables para eliminar las secuencias de tipo CRLF.
References
| https://github.com/nodejs/undici/security/advisories/GHSA-3cvr-822r-rqcc | exploit, third-party-advisory, web | |
| https://hackerone.com/reports/409943 | exploit, third-party-advisory, web | |
| https://github.com/nodejs/undici/releases/tag/v5.8.0 | release-notes, third-party-advisory, web | |
| https://security.netapp.com/advisory/ntap-20220915-0002/ | third-party-advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-31150 | advisory | |
| https://github.com/nodejs/undici/commit/a29a151d0140d095742d21a004023d024fe93259 | web | |
| https://github.com/nodejs/undici | package | |
| https://security.netapp.com/advisory/ntap-20220915-0002 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-31150 changed 2025-04-22 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3cvr-822r-rqcc changed 2023-11-08 | CC-BY-4.0 |
| NVD | CVE-2022-31150 changed 2026-06-17 | Public domain |