4.6medium
undici is vulnerable to CRLF Injection via upgrade option
- Severity
- 4.6medium CVSS:3.1 by openjs
- Exploit likelihood
- 0.32% (higher than 26% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- openjs
- Also known as
- GHSA-4992-7rv2-5pvq
Description
ImpactWhen an application passes user-controlled input to the upgrade option of client.request(), an attacker can inject CRLF sequences (\r\n) to: * Inject arbitrary HTTP headers * Terminate the HTTP request prematurely and smuggle raw data to non-HTTP services (Redis, Memcached, Elasticsearch) The vulnerability exists because undici writes the upgrade value directly to the socket without validating for invalid header characters: // lib/dispatcher/client-h1.js:1121 if (upgrade) { header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` }
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| undici | < 6.24.0; 7.0.0 < 7.24.0 Not affected: 6.24.0: 7.24.0 | CVE List |
| undici (npm) | before 6.24.0, from 7.0.0 before 7.24.0 | GitHub Advisory Database |
| nodejs undici | before 6.24.0, from 7.0.0 before 7.24.0 | NVD |
All scores
| openjs | 4.6medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N |
| GitHub | 4.6medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
ImpactWhen an application passes user-controlled input to the upgrade option of client.request(), an attacker can inject CRLF sequences (\r\n) to: * Inject arbitrary HTTP headers * Terminate the HTTP request prematurely and smuggle raw data to non-HTTP services (Redis, Memcached, Elasticsearch) The vulnerability exists because undici writes the upgrade value directly to the socket without validating for invalid header characters: // lib/dispatcher/client-h1.js:1121 if (upgrade) { header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` }
GitHub Advisory Database
Impact
When an application passes user-controlled input to the upgrade option of client.request(), an attacker can inject CRLF sequences (\r\n) to:
- Inject arbitrary HTTP headers
- Terminate the HTTP request prematurely and smuggle raw data to non-HTTP services (Redis, Memcached, Elasticsearch)
The vulnerability exists because undici writes the upgrade value directly to the socket without validating for invalid header characters:
// lib/dispatcher/client-h1.js:1121
if (upgrade) {
header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
}
Patches
Patched in the undici version v7.24.0 and v6.24.0. Users should upgrade to this version or later.
Workarounds
Sanitize the upgrade option string before passing to undici:
function sanitizeUpgrade(value) {
if (/[\r\n]/.test(value)) {
throw new Error('Invalid upgrade value')
}
return value
}
client.request({
upgrade: sanitizeUpgrade(userInput)
})
NVD (es)
ImpactoCuando una aplicación pasa entrada controlada por el usuario a la opción upgrade de client.request(), un atacante puede inyectar secuencias CRLF (\r\n) para: * Inyectar encabezados HTTP arbitrarios * Terminar la solicitud HTTP prematuramente y contrabandear datos sin procesar a servicios no HTTP (Redis, Memcached, Elasticsearch) La vulnerabilidad existe porque undici escribe el valor upgrade directamente al socket sin validar caracteres de encabezado no válidos: // lib/dispatcher/client-h1.js:1121 if (upgrade) { header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` }
References
| https://github.com/nodejs/undici/security/advisories/GHSA-4992-7rv2-5pvq | mitigation, patch, vendor-advisory, web | |
| https://hackerone.com/reports/3487198 | permissions-required, web | |
| https://cna.openjsf.org/security-advisories.html | vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-1527 | advisory | |
| https://github.com/nodejs/undici | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-1527 changed 2026-03-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4992-7rv2-5pvq changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-1527 changed 2026-06-17 | Public domain |