Packages / undici / Security

HighVulnerabilityGHSA-2m5v-pch6-74hxCVE-2026-109383Published 27 Oct 2026

undici vulnerable to TLS certificate validation bypass via dropped tls options in Agent

Your version

Affected releases · undici

  • 8.x8.0.0 – 8.12.1Fixed in 8.12.2
  • 7.x7.0.0 – 7.30.0Fixed in 7.30.1
  • 6.x6.0.0 – 6.29.0Fixed in 6.29.1
  • 5.x and older4.0.0 – 5.29.0No fix, no longer updated

On 8.x, the newest line:

npm install undici@8.12.2
Every release on a timeline
8.x
  1. Affected

    8.0.0 – 8.12.1

    22 releases

  2. Fixed

    8.12.2 – 8.13.1

    5 releases

7.x
  1. Affected

    7.0.0 – 7.30.0

    50 releases

  2. Fixed

    7.30.1 – 7.30.2

    2 releases

6.x
  1. Affected

    6.0.0 – 6.29.0

    56 releases

  2. Fixed

    6.29.1

    1 release

5.x
  1. Affected

    5.0.0 – 5.29.0

    59 releases

4.x
  1. Affected

    4.0.0 – 4.16.0

    49 releases

288 stable releases of undici, oldest to newest, one row per major.

What happens

Impact

undici's Agent passes its constructor options through a JSON-based deep clone (JSON.parse(JSON.stringify(...))) before forwarding them to each per-origin Pool. JSON cannot represent functions, so a caller-supplied tls option containing a checkServerIdentity callback is silently dropped before it reaches the TLS layer. As a result, a TLS peer whose certificate a custom checkServerIdentity was written to reject, but which passes Node's default hostname and chain checks, is silently accepted when the request is made through Agent. Because Agent is the default dispatcher behind request, fetch, and setGlobalDispatcher, this is the path most applications use. EnvHttpProxyAgent is also affected on its direct and NO_PROXY routes, which delegate to an internal Agent.

Only applications that pass a function-valued tls option (such as a custom checkServerIdentity for certificate or public-key pinning) are affected. Passing the same options through connect is not affected. This is the Agent counterpart of the BalancedPool certificate validation bypass fixed in CVE-2026-84961.

Patches

Upgrade to undici 6.29.1, 7.30.1, or 8.12.2. Agent now preserves the tls option outside the JSON clone, so custom TLS verification callbacks are forwarded to each origin unchanged.

Workarounds

Pass the TLS options through connect instead of tls. For proxied EnvHttpProxyAgent destinations, use requestTls / proxyTls.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.