/

CVE-2026-84961

Severity:

HIGH RISK

(7.4)

TLS Certificate Validation Bypass (CWE-295) in undici

CVE-2026-84961

Analyzed

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295

Impact:

TLS Certificate Validation Bypass

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A flaw in undici's BalancedPool can discard function-valued TLS options while cloning connection settings, preventing application-defined certificate checks from reaching the TLS layer. When a peer passes Node.js's default hostname and certificate-chain validation but should be rejected by a custom callback, the connection may be accepted.

Affected context

The issue occurs in undici's BalancedPool when applications provide function-valued options through the connect or TLS configuration. It affects relevant 7.x and 8.x releases within the described version ranges; Client, Pool, and Agent dispatchers are not affected because they extract these options before the internal cloning step. Risk depends on the application relying on custom certificate validation or connector callbacks to enforce additional trust decisions.

Exploit preconditions

  • Attack surface: Outbound HTTPS or TLS connections created through undici's BalancedPool
  • Required access: The ability to influence or position a peer that presents a certificate accepted by default TLS checks but rejected by the application's custom validation logic
  • Trigger point: Construction or use of a BalancedPool with function-valued connect or TLS options
  • Why exploitation is possible: The internal JSON-based clone removes functions before the options reach the TLS layer, causing custom validation behavior to be silently omitted

Why this happens

BalancedPool passes its complete options object through a deep-cloning process that serializes and reparses values as JSON. JSON serialization cannot preserve functions, so callbacks such as checkServerIdentity and function-valued connector options are discarded without an explicit error. This creates an insecure divergence between the validation policy intended by the application and the policy actually applied by the TLS layer, mapping to CWE-295: Improper Certificate Validation.

Potential impact

  • A server with a certificate rejected by custom application policy may be accepted
  • Sensitive outbound requests or credentials could be exposed to an unintended peer
  • Application-level trust boundaries could be bypassed
  • Service-to-service authentication decisions could be weakened
  • An attacker could gain access to data or operations available through the affected connection

General mitigation guidance

Mitigation generally focuses on preserving certificate-validation policy across connection configuration boundaries and avoiding silent transformation of security-sensitive options.

Common defensive patterns include:

  • Use a dispatcher path that preserves connect and TLS options before cloning occurs
  • Ensure security-sensitive callbacks are not passed through JSON-based cloning or serialization
  • Prefer secure-by-default TLS verification and avoid disabling built-in hostname or chain validation
  • Treat custom certificate policies as explicit, testable configuration rather than optional callbacks
  • Restrict outbound connection privileges and limit the data and operations available to each service
  • Maintain dependency versions containing the vendor's corrective changes as part of normal dependency governance

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis that identifies JSON serialization or deep-cloning of TLS and connector configuration
  • Code review checks for function-valued security options crossing serialization boundaries
  • Integration tests confirming that custom certificate rejection policies remain active through each supported dispatcher
  • Dependency and API policy checks that distinguish BalancedPool behavior from Client, Pool, and Agent behavior
  • Runtime telemetry for unexpected successful TLS connections to peers that should fail application-defined validation

Automated review tools can help flag serialization of security-sensitive connection settings during development.

Sources

SourceLink
cna.openjsf.orgcna.openjsf.org/security-advisories.html
github.comgithub.com/nodejs/undici/security/advisories/GHSA-w293-vg96-wgc3

Frequently asked

questions

It can affect an application when it connects through a vulnerable BalancedPool to a peer whose certificate passes default Node.js checks but violates the application's custom certificate policy. Exploitability therefore depends on the surrounding network and certificate-trust conditions.

An attacker generally needs to control, intercept, or otherwise cause traffic to reach a peer with a certificate that meets default validation while failing the application's discarded custom checks. No access to the application's local files is inherently required.

Use a connection-management path that preserves TLS and connector callbacks, and ensure the dependency includes the vendor's correction. Keep standard hostname and certificate-chain verification enabled.

Test security-sensitive options across serialization and cloning boundaries, enforce secure connection policies in code review and CI, and use integration tests that verify both default and application-defined certificate validation behavior.

Find out what's already
exploitable in your codebase.