Skip to content

chore(deps): update dependency undici@<6.23.0 to ^6.24.0 [security] - autoclosed#66

Closed
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-undici-6.23.0-vulnerability
Closed

chore(deps): update dependency undici@<6.23.0 to ^6.24.0 [security] - autoclosed#66
renovate[bot] wants to merge 1 commit intomainfrom
renovate/npm-undici-6.23.0-vulnerability

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 14, 2026

This PR contains the following updates:

Package Change Age Confidence
undici@<6.23.0 (source) ^6.23.0^6.24.0 age confidence

GitHub Vulnerability Alerts

CVE-2026-1528

Impact

A server can reply with a WebSocket frame using the 64-bit length form and an extremely large length. undici's ByteParser overflows internal math, ends up in an invalid state, and throws a fatal TypeError that terminates the process.

Patches

Patched in the undici version v7.24.0 and v6.24.0. Users should upgrade to this version or later.

Workarounds

There are no workarounds.

CVE-2026-1525

Impact

Undici allows duplicate HTTP Content-Length headers when they are provided in an array with case-variant names (e.g., Content-Length and content-length). This produces malformed HTTP/1.1 requests with multiple conflicting Content-Length values on the wire.

Who is impacted:

  • Applications using undici.request(), undici.Client, or similar low-level APIs with headers passed as flat arrays
  • Applications that accept user-controlled header names without case-normalization

Potential consequences:

  • Denial of Service: Strict HTTP parsers (proxies, servers) will reject requests with duplicate Content-Length headers (400 Bad Request)
  • HTTP Request Smuggling: In deployments where an intermediary and backend interpret duplicate headers inconsistently (e.g., one uses the first value, the other uses the last), this can enable request smuggling attacks leading to ACL bypass, cache poisoning, or credential hijacking

Patches

Patched in the undici version v7.24.0 and v6.24.0. Users should upgrade to this version or later.

Workarounds

If upgrading is not immediately possible:

  1. Validate header names: Ensure no duplicate Content-Length headers (case-insensitive) are present before passing headers to undici
  2. Use object format: Pass headers as a plain object ({ 'content-length': '123' }) rather than an array, which naturally deduplicates by key
  3. Sanitize user input: If headers originate from user input, normalize header names to lowercase and reject duplicates

CVE-2026-2229

Impact

The undici WebSocket client is vulnerable to a denial-of-service attack due to improper validation of the server_max_window_bits parameter in the permessage-deflate extension. When a WebSocket client connects to a server, it automatically advertises support for permessage-deflate compression. A malicious server can respond with an out-of-range server_max_window_bits value (outside zlib's valid range of 8-15). When the server subsequently sends a compressed frame, the client attempts to create a zlib InflateRaw instance with the invalid windowBits value, causing a synchronous RangeError exception that is not caught, resulting in immediate process termination.

The vulnerability exists because:

  1. The isValidClientWindowBits() function only validates that the value contains ASCII digits, not that it falls within the valid range 8-15
  2. The createInflateRaw() call is not wrapped in a try-catch block
  3. The resulting exception propagates up through the call stack and crashes the Node.js process

Patches

Has the problem been patched? What versions should users upgrade to?

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

CVE-2026-1526

Description

The undici WebSocket client is vulnerable to a denial-of-service attack via unbounded memory consumption during permessage-deflate decompression. When a WebSocket connection negotiates the permessage-deflate extension, the client decompresses incoming compressed frames without enforcing any limit on the decompressed data size. A malicious WebSocket server can send a small compressed frame (a "decompression bomb") that expands to an extremely large size in memory, causing the Node.js process to exhaust available memory and crash or become unresponsive.

The vulnerability exists in the PerMessageDeflate.decompress() method, which accumulates all decompressed chunks in memory and concatenates them into a single Buffer without checking whether the total size exceeds a safe threshold.

Impact

  • Remote denial of service against any Node.js application using undici's WebSocket client
  • A single compressed WebSocket frame of ~6 MB can decompress to ~1 GB or more
  • Memory exhaustion occurs in native/external memory, bypassing V8 heap limits
  • No application-level mitigation is possible as decompression occurs before message delivery

Patches

Users should upgrade to fixed versions.

Workarounds

No workaround are possible.

CVE-2026-1527

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:

// 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)
})

Release Notes

nodejs/undici (undici@<6.23.0)

v6.24.0

Compare Source

Undici v6.24.0 Security Release Notes (LTS)

This release backports fixes for security vulnerabilities affecting the v6 line.

Upgrade guidance

All users on v6 should upgrade to v6.24.0 or later.

Fixed advisories

Not applicable to v6

Affected and patched ranges (v6)

References


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/npm-undici-6.23.0-vulnerability branch from 1543afc to 8391147 Compare March 15, 2026 01:37
@renovate renovate bot changed the title chore(deps): update dependency undici@&lt;6.23.0 to ^6.24.1 [security] chore(deps): update dependency undici@&lt;6.23.0 to ^6.24.0 [security] Mar 15, 2026
@renovate renovate bot changed the title chore(deps): update dependency undici@&lt;6.23.0 to ^6.24.0 [security] chore(deps): update dependency undici@&lt;6.23.0 to ^6.24.1 [security] Mar 20, 2026
@renovate renovate bot force-pushed the renovate/npm-undici-6.23.0-vulnerability branch from 8391147 to ec51d3a Compare March 20, 2026 13:59
@renovate renovate bot changed the title chore(deps): update dependency undici@&lt;6.23.0 to ^6.24.1 [security] chore(deps): update dependency undici@&lt;6.23.0 to ^6.24.0 [security] Mar 20, 2026
@renovate renovate bot force-pushed the renovate/npm-undici-6.23.0-vulnerability branch from ec51d3a to 5461b4c Compare March 20, 2026 14:00
@renovate renovate bot changed the title chore(deps): update dependency undici@&lt;6.23.0 to ^6.24.0 [security] chore(deps): update dependency undici@<6.23.0 to ^6.24.1 [security] Mar 26, 2026
@renovate renovate bot force-pushed the renovate/npm-undici-6.23.0-vulnerability branch from 5461b4c to 3613287 Compare March 26, 2026 18:40
@renovate renovate bot changed the title chore(deps): update dependency undici@<6.23.0 to ^6.24.1 [security] chore(deps): update dependency undici@<6.23.0 to ^6.24.0 [security] Mar 26, 2026
@renovate renovate bot force-pushed the renovate/npm-undici-6.23.0-vulnerability branch from 3613287 to 319eede Compare March 26, 2026 20:51
@renovate renovate bot changed the title chore(deps): update dependency undici@<6.23.0 to ^6.24.0 [security] chore(deps): update dependency undici@<6.23.0 to ^6.24.0 [security] - autoclosed Mar 27, 2026
@renovate renovate bot closed this Mar 27, 2026
@renovate renovate bot deleted the renovate/npm-undici-6.23.0-vulnerability branch March 27, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants