CVE-2026-123877
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, and it is widely used for web applications and server-side development.
An authorization bypass vulnerability (CVE-2026-123877) has been identified in the Node.js https.Agent, which allows attackers to bypass certificate validation by having a TLS session authenticated under one CA policy reused by a later request made under a stricter CA policy. The later request reports the server as authorized and sends its data to a server that its own CA policy would reject on a fresh connection.
Per OWASP: Confirmation of the user's identity, authentication, and session management is critical to protect against authentication-related attacks. OWASP maps CWE-295, Improper Certificate Validation, to this category.
This issue affects multiple versions of Node.js.
Details
Module Info
- Product: Node.js
- Affected packages: node
- Affected versions: <22.23.5, >=23.0.0 <24.22.3, >=25.0.0 <26.13.1
- GitHub repository: https://github.com/nodejs/node
- Published packages: https://github.com/nodejs/node/releases/tag/v12.22.12, https://github.com/nodejs/node/releases/tag/v14.21.3, https://github.com/nodejs/node/releases/tag/v16.20.2, https://github.com/nodejs/node/releases/tag/v18.20.8, https://github.com/nodejs/node/releases/tag/v20.20.2
- Package manager: Not applicable. Node.js is distributed as runtime builds from nodejs.org rather than as a published npm package.
- Fixed in:
- OSS Node.js 22.23.5, 24.22.3, 26.13.1
- NES for Node.js v12.22.22, v14.21.15, v16.20.17, v18.20.21, v20.20.6
Vulnerability Info
This Medium-severity vulnerability is found in the node package in multiple versions of Node.js. An https.Agent pools sockets and caches TLS sessions under a key built by Agent.prototype.getName(). When a new connection is created, the agent looks up a cached session with this._getSession(options._agentKey) and offers it for resumption, then stores the negotiated session with this._cacheSession(options._agentKey, session). The key is meant to separate requests whose TLS policies differ, but getName() appends the certificate authority, certificate and CRL options by plain string concatenation:
Agent.prototype.getName = function getName(options = kEmptyObject) {
let name = FunctionPrototypeCall(HttpAgent.prototype.getName, this, options);
name += ':';
if (options.ca)
name += options.ca;
name += ':';
if (options.cert)
name += options.cert;
// ...
name += ':';
if (options.crl)
name += options.crl;
// ...
};A request that omits ca appends nothing, while a request that passes ca: [] passes the truthiness check and appends the empty array, which stringifies to an empty string. Both requests therefore get the same agent key, even though their policies differ: omitting ca validates the server against the default trust store, while supplying ca replaces that store. A TLS session authenticated under the broader default policy is then handed to a connection made under the stricter ca: [] policy, and TLS 1.3 session resumption carries the earlier authentication forward. The second request reports authorized === true and transmits its data to a server it would reject on a fresh handshake. The same concatenation lets other distinct values collapse to one key, and the key leaves out TLS options that change the trust or identity policy, such as secureContext, allowPartialTrustChain, ALPNProtocols, minDHSize, pskCallback and session.
Mitigation
Node.js release lines prior to v22 are End-of-Life and will not receive any upstream updates to address this issue. For more information see here. The odd-numbered 23.x and 25.x release lines covered by the affected ranges are End-of-Life as well.
Users of the affected components should apply one of the following mitigations:
- Upgrade to a supported Node.js release that carries the fix (v22.23.5, v24.22.3 or v26.13.1 or later).
- Migrate affected applications away from the End-of-Life Node.js release lines.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
- aegis1337 (finder)
- mickeyjoe (finder)