CVE-2026-87018 in undiciinfo

Summary

by MITRE • 10/15/2026

undici is an HTTP client library for Node.js. In versions 4.2.1 through 6.29.0, 7.0.0 through 7.30.0, and 8.0.0 through 8.12.1, the client process crashes when a TLS 1.2 server renegotiates after the connection is established and presents a different, CA-trusted certificate whose hostname does not match the requested host. Node.js re-runs hostname verification on the renegotiated handshake and destroys the socket with a certificate-altname error, but undici's established-socket error handler asserted that this error code could never occur, so the peer-controlled error became an uncaught assertion that terminates the Node.js process, affecting both the HTTP/1.1 and HTTP/2 paths. A malicious or compromised HTTPS endpoint reached through undici or the global fetch() can crash the client with a single server-initiated renegotiation, taking down all in-flight requests and background work in the process, and exploitation needs no CA compromise because the attacker controls the endpoint and can present two ordinary valid certificates. Only TLS 1.2 is affected, since TLS 1.3 does not support renegotiation. The issue is fixed in undici 6.29.1, 7.30.1, and 8.12.2, and users should upgrade to one of those versions or later. As a workaround, restrict outbound connections to TLS 1.3 so renegotiation cannot occur, when the target endpoints support it.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 10/15/2026

The vulnerability identified in undici, an HTTP client library for Node.js, represents a critical failure in error handling logic that leads to process termination under specific TLS negotiation conditions. This flaw affects multiple versions of the library, specifically those ranging from 4.2.1 through 6.29.0, 7.0.0 through 7.30.0, and 8.0.0 through 8.12.1. The core issue arises when a client connects to an HTTPS server using TLS version 1.2 and the server initiates a renegotiation of the secure channel after the initial connection is established. During this renegotiation phase, if the server presents a different certificate that is trusted by the Certificate Authority but whose hostname does not match the originally requested host, Node.js performs its standard security checks and re-runs hostname verification on the new handshake. This process results in a socket destruction due to a certificate-altname mismatch error.

The technical root cause lies within undici's established-socket error handler, which contains an assertion that incorrectly assumes this specific certificate-altname error code can never occur during normal operation. Because of this flawed assumption, when Node.js passes the peer-controlled error back to the library, it triggers an uncaught exception rather than being handled gracefully. This results in the immediate termination of the entire Node.js process. The vulnerability impacts both HTTP/1.1 and HTTP/2 communication paths, meaning that any service relying on undici for outbound network requests is susceptible to this denial-of-service condition if it interacts with a malicious or compromised HTTPS endpoint capable of forcing such renegotiations.

From an operational perspective, the impact of this vulnerability is severe as it allows for remote code execution in the form of process crashes without requiring any compromise of Certificate Authorities. An attacker who controls or can manipulate the target HTTPS endpoint can exploit this by presenting two ordinary valid certificates during the initial connection and subsequent renegotiation phases. The first certificate matches the requested host, establishing trust, while the second, presented during renegotiation, does not match. This triggers the assertion failure in undici, causing all in-flight requests to fail and terminating any background work associated with that Node.js process. Since TLS 1.3 explicitly removes support for renegotiation to mitigate similar issues, this vulnerability is strictly limited to environments using TLS 1.2 or earlier protocols where such handshake modifications are permitted by the standard.

This incident aligns with CWE-617, which describes Reachable Assertion vulnerabilities, and can be mapped to MITRE ATT&CK techniques related to Denial of Service via application layer exploits. The lack of proper error handling for expected but rare protocol states allows an external actor to disrupt service availability effectively. To mitigate this risk, users must upgrade undici to version 6.29.1, 7.30.1, or 8.12.2 and later, where the assertion has been removed and proper error handling is implemented. For environments that cannot immediately update their dependencies, a viable workaround involves restricting outbound connections to enforce TLS 1.3 exclusively for all HTTPS endpoints that support it. By disabling TLS 1.2 renegotiation capabilities at the protocol level through configuration changes or network policies, organizations can prevent the specific handshake sequence required to trigger this vulnerability until patches are fully deployed across their infrastructure.

Responsible

Openjs

Reservation

09/08/2026

Disclosure

10/15/2026

Moderation

accepted

EPSS

0.00187

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!