---
id: "CVE-2026-87018"
kind: "vulnerability"
aliases: ["CVE-2026-87018", "GHSA-qrxm-fqhp-jwvm"]
title: "undici vulnerable to Denial of Service via TLS 1.2 certificate-changing renegotiation"
severity: "high"
cvss: 7.5
epss: 0.00187
exploited: false
status: "open"
category: "package"
products: [{"name": "undici", "fixed": ["6.29.1"], "affected": ">= 4.2.1, < 6.29.1", "ecosystem": "npm"}, {"name": "undici", "fixed": ["7.30.1"], "affected": ">= 7.0.0, < 7.30.1", "ecosystem": "npm"}, {"name": "undici", "fixed": ["8.12.2"], "affected": ">= 8.0.0, < 8.12.2", "ecosystem": "npm"}, {"name": "nodejs undici", "fixed": ["6.29.1"], "affected": ">= 4.2.1, < 6.29.1", "ecosystem": "vendor"}, {"name": "nodejs undici", "fixed": ["7.30.1"], "affected": ">= 7.0.0, < 7.30.1", "ecosystem": "vendor"}, {"name": "nodejs undici", "fixed": ["8.12.2"], "affected": ">= 8.0.0, < 8.12.2", "ecosystem": "vendor"}]
ecosystems: ["npm", "vendor"]
tags: ["cwe-248", "cwe-617", "fetch", "node.js", "npm", "package", "undici"]
not_affected_if: ["patched-version", "tls-1.3-only"]
published_at: "2026-10-15T19:17:46+00:00"
first_seen_at: "2026-10-27T19:04:55+00:00"
updated_at: "2026-10-27T19:33:18+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-qrxm-fqhp-jwvm", "first_seen_at": "2026-10-27T19:04:55+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-87018", "first_seen_at": "2026-10-27T19:33:18+00:00"}]
---

# undici vulnerable to Denial of Service via TLS 1.2 certificate-changing renegotiation

undici, the HTTP client behind Node's global fetch, crashes the whole Node.js process when a TLS 1.2 server renegotiates the connection and presents a certificate whose hostname does not match. An attacker who controls or can impersonate the HTTPS endpoint can take down all in-flight requests and background work with one renegotiation.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:undici affected >= 4.2.1, < 6.29.1 fixed 6.29.1
- npm:undici affected >= 7.0.0, < 7.30.1 fixed 7.30.1
- npm:undici affected >= 8.0.0, < 8.12.2 fixed 8.12.2
- vendor:nodejs undici affected >= 4.2.1, < 6.29.1 fixed 6.29.1
- vendor:nodejs undici affected >= 7.0.0, < 7.30.1 fixed 7.30.1
- vendor:nodejs undici affected >= 8.0.0, < 8.12.2 fixed 8.12.2

## How to check

- Run `npm ls undici` in each project and check whether the resolved version falls in the affected ranges: `>= 4.2.1, < 6.29.1`, `>= 7.0.0, < 7.30.1`, or `>= 8.0.0, < 8.12.2`.
- Check whether your Node process fetches from or connects to untrusted or third-party HTTPS endpoints over TLS 1.2.

## Fix

- Upgrade undici to `6.29.1`, `7.30.1`, or `8.12.2` depending on the major line in use.
- Workaround until upgraded: restrict outbound TLS to 1.3 with `connect: { minVersion: 'TLSv1.3', maxVersion: 'TLSv1.3' }` on the client or agent, only where the target endpoints support TLS 1.3.

## Timeline

- 2026-10-27T19:04:55+00:00 ghsa https://github.com/advisories/GHSA-qrxm-fqhp-jwvm
- 2026-10-27T19:33:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-87018

## From the sources

## Impact

undici crashes the client process 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 `ERR_TLS_CERT_ALTNAME_INVALID`. undici's established socket error handler asserted that this error code could never occur, so the peer-controlled error became an uncaught `AssertionError` that terminates the Node.js process. Both the HTTP/1.1 and HTTP/2 paths are affected.

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. Only TLS 1.2 is affected, because TLS 1.3 does not support renegotiation. Exploitation does not require a CA compromise: the attacker controls the endpoint and can present two ordinary valid certificates, the first matching the requested URL and the second intentionally not matching it.

## Patches

Upgrade to undici 6.29.1, 7.30.1, or 8.12.2.

## Workarounds

Restrict outbound connections to TLS 1.3, for example by setting `connect: { minVersion: 'TLSv1.3', maxVersion: 'TLSv1.3' }` on the client or agent, so that renegotiation cannot occur, when the target endpoints support TLS 1.3.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
