CVE-2026-123875
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 vulnerability (CVE-2026-123875) has been identified in the Node.js HTTP/2 server, which allows unauthenticated clients to crash a server that serves files with stream.respondWithFile() or stream.respondWithFD() by cancelling the download. No crafted frames are needed, and the crash happens over both TLS and cleartext HTTP/2.
Per OWASP: The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed. There are many ways to make a service unavailable for legitimate users by manipulating network packets, programming, logical, or resources handling vulnerabilities, among others. If a service receives a very large number of requests, it may cease to be available to legitimate users. In the same way, a service may stop if a programming vulnerability is exploited, or the way the service handles resources it uses.
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/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. When an HTTP/2 server answers a request with stream.respondWithFile() or stream.respondWithFD(), Node.js creates a StreamPipe that reads the file on the libuv thread pool and writes each chunk to the HTTP/2 stream. If the client cancels the request while a file read is still pending, the HTTP/2 stream is destroyed before that read completes. When the read finishes, StreamPipe::ProcessData() tries to write the chunk to the destroyed stream. The write fails synchronously, so no write request is allocated, and the pipe reports the failure with a NULL WriteWrap:
void StreamPipe::ProcessData(size_t nread,
std::unique_ptr<BackingStore> bs) {
CHECK(uses_wants_write_ || pending_writes_ == 0);
uv_buf_t buffer = uv_buf_init(static_cast<char*>(bs->Data()), nread);
StreamWriteResult res = sink()->Write(&buffer, 1);
pending_writes_++;
if (!res.async) {
writable_listener_.OnStreamAfterWrite(nullptr, res.err);
}
// ...
}Because the status is non-zero, StreamPipe::WritableListener::OnStreamAfterWrite() unpipes and forwards the same NULL pointer to the stream's previous listener:
if (status != 0) {
CHECK_NOT_NULL(previous_listener_);
StreamListener* prev = previous_listener_;
pipe->Unpipe();
prev->OnStreamAfterWrite(w, status);
return;
}For an HTTP/2 stream the previous listener is a ReportWritesToJSStreamListener, which hands the request to OnStreamAfterReqFinished(). That function dereferences both the stream and the request without checking either:
void ReportWritesToJSStreamListener::OnStreamAfterReqFinished(
StreamReq* req_wrap, int status) {
StreamBase* stream = static_cast<StreamBase*>(stream_);
Environment* env = stream->stream_env();
if (!env->can_call_into_js()) return;
AsyncWrap* async_wrap = req_wrap->GetAsyncWrap();
// ...
}req_wrap->GetAsyncWrap() on the NULL request crashes the process with a segmentation fault. The race needs nothing beyond ordinary client behavior: opening requests for a served file and closing the stream or session before the transfer finishes. A handful of cancelled requests against a default file-serving handler is enough to take the server down, and every connected client loses service with it.
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 affected Node.js 23 and 25 release lines 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
- Chris Rohlf in collaboration with Claude and Anthropic Research (finder)