[v26.x backport] http2: avoid uaf while receiving and sending rst_stream - #65264
Merged
aduh95 merged 1 commit intoAug 13, 2026
Merged
Conversation
Collaborator
|
Review requested:
|
Contributor
|
116 tests failed on the FIPS jobs, that's expected and already fixed on the staging branch. Closing and reopening to fix that |
aduh95
approved these changes
Aug 13, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v26.x-staging #65264 +/- ##
=================================================
- Coverage 90.29% 90.24% -0.05%
=================================================
Files 729 729
Lines 242763 242760 -3
Branches 46920 46044 -876
=================================================
- Hits 219191 219073 -118
- Misses 15024 15133 +109
- Partials 8548 8554 +6
🚀 New features to boost your workflow:
|
Collaborator
Mark the session as receiving around nghttp2_session_mem_recv() and defer RST_STREAM handling while receive is in progress. This prevents closing a stream while nghttp2 still processes it and avoids heap-use-after-free in nghttp2_session_mem_recv2(). Fixes: nodejs#64113 Signed-off-by: Evgeniy Gorbanev <gorbanev.es@gmail.com> PR-URL: nodejs#64166 Backport-PR-URL: nodejs#65264 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95
force-pushed
the
backport-64166-v26.x-staging
branch
from
August 13, 2026 21:34
9b55403 to
ca26282
Compare
Contributor
|
Landed in ca26282 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #64166 to
v26.x-staging.Original PR: http2: avoid uaf while receiving and sending rst_stream
Fixes: #64113
Backport note
The upstream fix relies on the http2 JS close/destroy refactor from PR #63249 (
http2: error for incomplete reads on RST, auto-drain, deprecate aborted), which is semver-major and cannot be backported to a release branch. Onv26.x(which lacks that refactor) the C++ backport alone stallstest-http2-many-writes-and-destroy.js(graceful close never completes — the server's GOAWAY is not flushed because theSendPendingData()guard returns busy duringnghttp2_session_mem_recv()).So this backport includes a second commit that drops the send guard. The primary UAF protection (the RST_STREAM / Destroy / Close deferrals) remains intact, and the full http2 suite passes.