CVE-2026-123872
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-123872) has been identified in the Node.js TLS server, which allows attackers who hold a client certificate accepted for one hostname to reach a hostname with a stricter client-certificate policy. A client that authenticates under a permitted servername can renegotiate the TLS 1.2 connection under a different servername and carry its existing authentication to the protected host.
Per OWASP: Confirmation of the user's identity, authentication, and session management is critical to protect against authentication-related attacks.
This issue affects multiple versions of Node.js.
Details
Module Info
- Product: Node.js
- Affected packages:
node - Affected versions: >=0.0.0 <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/v22.23.4
- 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 High-severity vulnerability is found in the node package in multiple versions of Node.js. A Node.js TLS server picks a secure context per hostname through Server Name Indication (SNI), for example with server.addContext() or the SNICallback option, so each hostname can have its own ca, requestCert and client-certificate policy. The native servername callback that applies that choice runs on every ClientHello the server receives, not just the first one on a connection:
int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) {
TLSWrap* p = static_cast<TLSWrap*>(SSL_get_app_data(s));
Environment* env = p->env();
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());
const char* servername = GetServerName(s);
if (!Set(env, p->GetOwner(), env->servername_string(), servername))
return SSL_TLSEXT_ERR_NOACK;
Local<Value> ctx = p->object()->Get(env->context(), env->sni_context_string())
.FromMaybe(Local<Value>());
// ...
SecureContext* sc = Unwrap<SecureContext>(ctx.As<Object>());
CHECK_NOT_NULL(sc);
p->sni_context_ = BaseObjectPtr<SecureContext>(sc);
ConfigureSecureContext(sc);
CHECK_EQ(SSL_set_SSL_CTX(p->ssl_.get(), sc->ctx().get()), sc->ctx().get());
p->SetCACerts(sc);
return SSL_TLSEXT_ERR_OK;
}Node.js servers accept client-initiated TLS 1.2 renegotiation by default, up to tls.CLIENT_RENEG_LIMIT renegotiations per window. Each renegotiation sends a new ClientHello, and the callback above accepts whatever servername it carries: it overwrites the socket's servername and swaps the connection to that hostname's SSL_CTX with SSL_set_SSL_CTX(), without checking that the name matches the one the connection was established for. A client can therefore complete the initial handshake, including client-certificate authentication, under a hostname whose policy its certificate satisfies, then renegotiate under the servername of a host that requires a different or stricter client certificate. The connection keeps its existing authentication while the application now sees the protected hostname in socket.servername, so routing or access decisions made per hostname apply the weaker policy's authentication to the protected host. Session resumption is not tied to the servername either, so a session established for one hostname can be resumed under another.
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 Node.js 23.x and 25.x 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
- Tim Perry (finder)