CVE-2026-123862
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.
A denial of service (DoS) vulnerability (CVE-2026-123862) has been identified in the Node.js zlib streaming API, which allows a peer to crash a process by disconnecting while data is being compressed. When a zlib stream is destroyed while a params() call is still pending, Node.js throws an uncatchable ERR_INTERNAL_ASSERTION that bypasses the stream's error event and every callback, and the process exits.
Per OWASP: The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed.
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/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 Low-severity vulnerability is found in the node package in multiple versions of Node.js. The flaw is in the built-in zlib module (lib/zlib.js). Zlib.prototype.params() cannot change the compression level or strategy while a write is in progress, so it queues a Z_SYNC_FLUSH write and finishes its work in that write's callback, paramsAfterFlushCallback:
function paramsAfterFlushCallback(level, strategy, callback) {
assert(this._handle, 'zlib binding closed');
this._handle.params(level, strategy);
if (!this.destroyed) {
this._level = level;
this._strategy = strategy;
if (callback) callback();
}
}If the stream is destroyed before the queued flush runs, the native handle is closed and this._handle is cleared. Writable still invokes the pending write callback, passing a stream-destroyed error, but paramsAfterFlushCallback ignores that argument and asserts that the handle exists. The assertion fails and throws ERR_INTERNAL_ASSERTION ("zlib binding closed") from inside the stream internals. Because the exception is raised synchronously within the write callback machinery, it is not routed to the stream's error event, the params() callback, or the pipeline() callback, so no application handler can catch it and the process terminates.
pipeline() destroys every stream in the chain when a peer goes away. An application that calls deflate.params() on a compression stream piped to a network peer can therefore be crashed by a peer that disconnects while a params() call is pending. Applications that never call params() on a zlib stream are not affected.
Steps to Reproduce
- Save the following as
repro.js:const zlib = require('zlib'); const deflate = zlib.createDeflate(); deflate.on('error', (err) => console.log('error event:', err.code)); deflate.write('x'); deflate.params(9, zlib.constants.Z_DEFAULT_STRATEGY, (err) => { console.log('params callback:', err && err.code); }); deflate.destroy(); - Run it with an affected Node.js version:
node repro.js. - Observe that neither the
errorlistener nor theparams()callback runs. The process exits with an uncaughtError [ERR_INTERNAL_ASSERTION]: zlib binding closedthrown fromparamsAfterFlushCallback.
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 and 25 release lines are also End-of-Life.
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
Chris Rohlf in collaboration with Claude and Anthropic Research (finder)