Repository navigation
Conversation
A TransformStream write that parks on backpressure was resumed from the read that lifted the backpressure, so transform(), the writes queued behind it, and flush() ran in the reader's async context instead of the writer's. Capture the async context frame when the write parks and restore it while the continuation runs, matching the context the spec's [[backpressureChangePromise]] reaction had. Fixes: nodejs#66906 Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: nodejs#66907 Backport-PR-URL: nodejs#66915 Fixes: nodejs#66906 Refs: nodejs#66906 Refs: nodejs#66907 Reviewed-By: James M Snell <jasnell@gmail.com>
Cancelling an in-flight respondWithFile() download can leave a file read pending on the thread pool after the HTTP/2 stream has been destroyed. When that read completes, StreamPipe forwards a null WriteWrap to the previous listener, which dereferences it in ReportWritesToJSStreamListener::OnStreamAfterReqFinished(), crashing the server with a NULL pointer dereference (segfault). Guard against a null stream and null request in OnStreamAfterReqFinished() so the listener returns early. This is a backport of the null-check fix that landed on main in 1576cb8. Refs: https://hackerone.com/4150894 Signed-off-by: Matteo Collina <hello@matteocollina.com> Assisted-by: pi
mcollina
force-pushed
the
fix-4150894-v26.x
branch
from
November 4, 2026 13:44
f83caf3 to
3a9e3e9
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v26.x-staging #67252 +/- ##
=================================================
+ Coverage 90.24% 90.76% +0.52%
=================================================
Files 729 775 +46
Lines 242760 273491 +30731
Branches 46044 52524 +6480
=================================================
+ Hits 219073 248246 +29173
- Misses 15133 16126 +993
- Partials 8554 9119 +565
🚀 New features to boost your workflow:
|
This was referenced Nov 5, 2026
aduh95
approved these changes
Nov 7, 2026
Collaborator
Collaborator
aduh95
force-pushed
the
v26.x-staging
branch
from
November 11, 2026 16:33
e65b707 to
a5bbc7b
Compare
MikeMcC399
pushed a commit
to MikeMcC399/node
that referenced
this pull request
Nov 11, 2026
Cancelling an in-flight `respondWithFile()` download can leave a file read pending on the thread pool after the HTTP/2 stream has been destroyed. When that read completes, `StreamPipe` forwards a null `WriteWrap` to the previous listener, which dereferences it in `ReportWritesToJSStreamListener::OnStreamAfterReqFinished()`, crashing the server with a NULL pointer dereference (segfault). Guard against a null stream and null request in `OnStreamAfterReqFinished()` so the listener returns early. Refs: https://hackerone.com/4150894 Refs: nodejs#64623 Signed-off-by: Matteo Collina <hello@matteocollina.com> Assisted-by: pi PR-URL: nodejs#67252 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> CVE-ID: CVE-2026-123875
MikeMcC399
pushed a commit
to MikeMcC399/node
that referenced
this pull request
Nov 11, 2026
Cancelling an in-flight `respondWithFile()` download can leave a file read pending on the thread pool after the HTTP/2 stream has been destroyed. When that read completes, `StreamPipe` forwards a null `WriteWrap` to the previous listener, which dereferences it in `ReportWritesToJSStreamListener::OnStreamAfterReqFinished()`, crashing the server with a NULL pointer dereference (segfault). Guard against a null stream and null request in `OnStreamAfterReqFinished()` so the listener returns early. Refs: https://hackerone.com/4150894 Refs: nodejs#64623 Signed-off-by: Matteo Collina <hello@matteocollina.com> Assisted-by: pi PR-URL: nodejs#67252 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> CVE-ID: CVE-2026-123875
MikeMcC399
pushed a commit
to MikeMcC399/node
that referenced
this pull request
Nov 11, 2026
Cancelling an in-flight `respondWithFile()` download can leave a file read pending on the thread pool after the HTTP/2 stream has been destroyed. When that read completes, `StreamPipe` forwards a null `WriteWrap` to the previous listener, which dereferences it in `ReportWritesToJSStreamListener::OnStreamAfterReqFinished()`, crashing the server with a NULL pointer dereference (segfault). Guard against a null stream and null request in `OnStreamAfterReqFinished()` so the listener returns early. Refs: https://hackerone.com/4150894 Refs: nodejs#64623 Signed-off-by: Matteo Collina <hello@matteocollina.com> Assisted-by: pi PR-URL: nodejs#67252 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> CVE-ID: CVE-2026-123875
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.
Fixes a null pointer dereference that can occur when an in-flight
respondWithFile()download is cancelled.If the HTTP/2 stream is destroyed while a file read is still pending on the thread pool,
StreamPipe::ProcessData()forwards a null write request to the previous stream listener, andReportWritesToJSStreamListener::OnStreamAfterReqFinished()dereferences it, crashing the process.Guard against a null stream and a null request in
OnStreamAfterReqFinished(). Adds a regression test that cancelsrespondWithFile()downloads while a read is in flight.This was part of #64623, but backported separately