CVE-2026-141996: undici vulnerable to TLS certificate validation bypass via servername reused on cross-origin redirects
undici is an HTTP client for Node.js. In versions 6.8.0 through 6.29.1, 7.0.0 through 7.30.3, and 8.0.0 through 8.14.0, the redirect interceptor builds each follow-up request from the options of the previous one and, on a cross-origin redirect, kept the TLS servername of the first request, so the redirect target's certificate was validated against the first host's name instead of its own. Applications are affected when they follow redirects with the redirect interceptor and the first request carries a servername, either passed as a request option or set by the dns interceptor composed outside the redirect interceptor, and requests sent through a ProxyAgent tunnel without requestTls are affected in the same way, while fetch is not affected. A party that holds a valid certificate for the first host and can intercept traffic to the redirect target can impersonate the target and read or modify the redirected request and its response. The issue is fixed in undici 6.29.2, 7.30.4, and 8.14.1, and users should upgrade to one of those versions or later. As a workaround, compose the dns interceptor inside the redirect interceptor and do not pass a servername on requests that follow redirects, or disable automatic redirects and follow them in application code.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 6.29.2 - Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 7.30.4 - Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 8.14.1
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications are affected only when they follow redirects using the redirect interceptor and the initial request has a servername. This can occur when servername is supplied as a request option or when a dns interceptor is composed outside the redirect interceptor; ProxyAgent tunnel requests without requestTls are also affected. The fetch API is not affected.
What must an attacker be able to do to exploit it?
The attacker must hold a valid TLS certificate for the original host and be able to intercept traffic to the cross-origin redirect target. They can then impersonate the redirect target and read or alter the redirected request and response.
What can be done if an upgrade cannot be applied immediately?
Compose the dns interceptor inside the redirect interceptor, and do not pass a servername on requests that follow redirects. Upgrading to undici 6.29.2, 7.30.4, 8.14.1, or later is the recommended remediation.