VDB
Sign up
HIGH7.4

GHSA-2m5v-pch6-74hx

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

Quick fix

GHSA-2m5v-pch6-74hx — undici: upgrade to the fixed version with the command below.

npm install undici@6.29.1

Details

### 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`.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm/undici
Introduced in: 4.0.0Fixed in: 6.29.1
Fixnpm install undici@6.29.1
npm/undici
Introduced in: 7.0.0Fixed in: 7.30.1
Fixnpm install undici@7.30.1
npm/undici
Introduced in: 8.0.0Fixed in: 8.12.2
Fixnpm install undici@8.12.2

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:npm/undici"]}'