Improper Certificate Validation Affecting undici package, versions >=6.8.0 <6.29.2>=7.0.0 <7.30.4>=8.0.0 <8.14.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.38% (35th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-UNDICI-23775839
  • published5 Dec 2026
  • disclosed5 Dec 2026
  • creditTravis Baldwin

Introduced: 5 Dec 2026

NewCVE-2026-141996  (opens in a new tab)
CWE-295  (opens in a new tab)

How to fix?

Upgrade undici to version 6.29.2, 7.30.4, 8.14.1 or higher.

Overview

undici is an An HTTP/1.1 client, written from scratch for Node.js

Affected versions of this package are vulnerable to Improper Certificate Validation via the redirect interceptor in lib/handler/redirect-handler.js, which builds each follow-up request from the options of the previous one and, on a cross-origin redirect, retains the TLS servername of the first request. As a result, the redirect target's certificate is validated against the first host's name instead of its own, allowing a party that holds a valid certificate for the first host and can intercept traffic to the redirect target to impersonate that target and read or modify the redirected request and its response.

Note: This is only exploitable when redirects are followed via interceptors.redirect() and the first request carries a servername (passed as a request option, set by interceptors.dns() composed outside the redirect interceptor, or sent through a ProxyAgent tunnel without requestTls). fetch() is not affected.

Workaround

Compose the dns interceptor inside the redirect interceptor (agent.compose(interceptors.dns(), interceptors.redirect())), and do not pass a servername on requests that follow redirects. Alternatively, disable automatic redirects and follow them in application code.

CVSS Base Scores

version 4.0
version 3.1