CVE-2026-84961: undici vulnerable to TLS certificate validation bypass via dropped connect options in BalancedPool
undici's BalancedPool constructor passes its entire options object through an internal deep-clone that serializes and reparses the value as JSON. Because JSON cannot represent functions, any function-valued TLS option, such as a caller-supplied checkServerIdentity callback or a custom connector inside the connect option, is silently discarded before it reaches the TLS layer. As a result a peer whose certificate the application's custom checkServerIdentity was written to reject, but which still passes Node's default hostname and chain checks, is accepted when reached through BalancedPool. The Client, Pool, and Agent dispatchers are not affected because they extract the connect and tls options before cloning. This affects undici versions from 7.24.1 up to 7.29.1 and from 8.0.0 up to 8.10.2, and only when the application supplies a function-valued connect or tls option to BalancedPool. Users should upgrade to undici 7.29.1 or 8.10.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
undicito a version that resolves this vulnerability.Fixed in 7.29.1 - Upgrade
Upgrade
undicito a version that resolves this vulnerability.Fixed in 8.10.2
Event History
Frequently Asked Questions
Which deployments are affected?
Only applications that use undici's BalancedPool and supply a function-valued connect or TLS option are affected. This includes custom checkServerIdentity callbacks and custom connectors passed through the connect option; Client, Pool, and Agent dispatchers are not affected.
What certificate validation can be bypassed?
A peer certificate can bypass the application's custom checkServerIdentity policy because that callback is discarded before reaching the TLS layer. The peer must still pass Node's default hostname and certificate-chain validation.
Which undici versions need remediation?
Affected versions are 7.24.1 through 7.29.1 and 8.0.0 through 8.10.2. Upgrade to undici 7.29.1 or 8.10.2.
How can I determine whether my application is exposed?
Review BalancedPool construction and its options for function-valued TLS or connect settings, especially checkServerIdentity callbacks and custom connectors. If those functions are used with BalancedPool on an affected version, they are silently removed by the internal cloning step.