CVE-2026-1527: Undici Undici Has CRLF Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-4992-7rv2-5pvq
CVSS 4.6
CWE-93
Published
Advisory Summary

CVE-2026-1527 is a MODERATE (CVSS 4.6) undici has crlf injection vulnerability (CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')) affecting Undici libraries in the npm ecosystem. The issue involves undici has crlf injection in undici via `upgrade` option. Remediation is available by upgrading affected packages to version 6.24.0, 7.24.0.

CVE-2026-1527 at a Glance

CVE Identifier CVE-2026-1527
GHSA Identifier GHSA-4992-7rv2-5pvq
Severity MODERATE
CVSS v3.1 Base Score 4.6
CWE Classification CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')
Affected Product Undici
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-1527

To remediate this vulnerability, upgrade all affected Undici dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

undici fixed: 6.24.0
npm install undici@6.24.0
undici fixed: 7.24.0
npm install undici@7.24.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls undici

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-1527, inspect your project dependencies using npm:

npm ls undici

Analyze the terminal output to locate any version of Undici in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.24.0), your application is affected.

Note: The npm ls undici command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection'), where the product uses crlf (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes crlf sequences from inputs. In Undici, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact When an application passes user-controlled input to the `upgrade` option of `client.request()`, an attacker can inject CRLF sequences (`\r\n`) to: 1. Inject arbitrary HTTP headers 2. 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: ```javascript // 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: ```javascript function sanitizeUpgrade(value) { if (/[\r\n]/.test(value)) { throw new Error('Invalid upgrade value') } return value } client.request({ upgrade: sanitizeUpgrade(userInput) }) ```

CVE-2026-1527 Affected Undici Versions

2 component(s)
Fixed Versions:
6.24.07.24.0
Product / Package Ecosystem Affected Versions Fixed Version
undici
npm
< 6.24.0
6.24.0
undici
npm
≥ 7.0.0
< 7.24.0
7.24.0

References

Frequently Asked Questions

What is CVE-2026-1527?
CVE-2026-1527 is a security vulnerability in Undici involving Undici has CRLF Injection in undici via `upgrade` option under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection').
Which Undici versions are affected?
Affected versions include releases prior to 6.24.0, 7.24.0 across affected packages: undici.
What version fixes CVE-2026-1527?
Upgrading to 6.24.0, 7.24.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is undici affected?
Yes, undici is affected in releases prior to 6.24.0, 7.24.0. Upgrade your dependency to 6.24.0, 7.24.0 or later.
What is the CVSS score of CVE-2026-1527?
CVE-2026-1527 has a CVSS v3.1 base score of 4.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-1527?
CVE-2026-1527 is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection') (The product uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.).
How can I check npm dependencies for CVE-2026-1527?
Run the dependency tree command: 'npm ls undici'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4992-7rv2-5pvq",
  "modified" : "2026-03-13T20:41:26Z",
  "published" : "2026-03-13T20:41:26Z",
  "aliases" : [ "CVE-2026-1527" ],
  "summary" : "Undici has CRLF Injection in undici via `upgrade` option",
  "details" : "### Impact\n\nWhen an application passes user-controlled input to the `upgrade` option of `client.request()`, an attacker can inject CRLF sequences (`\\r\\n`) to:\n\n1. Inject arbitrary HTTP headers\n2. Terminate the HTTP request prematurely and smuggle raw data to non-HTTP services (Redis, Memcached, Elasticsearch)\n\nThe vulnerability exists because undici writes the `upgrade` value directly to the socket without validating for invalid header characters:\n\n```javascript\n// lib/dispatcher/client-h1.js:1121\nif (upgrade) {\n  header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n}\n```\n\n### Patches\n\n Patched in the undici version v7.24.0 and v6.24.0. Users should upgrade to this version or later.\n\n### Workarounds\n\nSanitize the `upgrade` option string before passing to undici:\n\n```javascript\nfunction sanitizeUpgrade(value) {\n  if (/[\\r\\n]/.test(value)) {\n    throw new Error('Invalid upgrade value')\n  }\n  return value\n}\n\nclient.request({\n  upgrade: sanitizeUpgrade(userInput)\n})\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "undici"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.24.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "undici"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.24.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/security/advisories/GHSA-4992-7rv2-5pvq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-1527"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/3487198"
  }, {
    "type" : "WEB",
    "url" : "https://cna.openjsf.org/security-advisories.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nodejs/undici"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-93" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-13T20:41:26Z",
    "nvd_published_at" : "2026-03-12T21:16:25Z"
  }
}