fix: refactor to avoid UAF in NodeStreamLoader - #52474
Merged
Merged
Conversation
Assisted-by: Claude Opus 5
Assisted-by: Claude Opus 5
Assisted-by: Claude Opus 5
dsanders11
marked this pull request as ready for review
July 28, 2026 05:28
deepak1556
approved these changes
Jul 28, 2026
deepak1556
left a comment
Member
There was a problem hiding this comment.
How was this case identified ?
Member
Author
|
@deepak1556, it was flagged by the Clang Static Analyzer, via clang-tidy output |
Member
|
Awesome, thank you! |
ckerr
approved these changes
Jul 28, 2026
|
Release Notes Persisted
|
This was referenced Jul 29, 2026
Contributor
|
I have automatically backported this PR to "41-x-y", please check out #52513 |
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #52514 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #52515 |
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #52516 |
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.
Description of Change
Under specific circumstances
NodeStreamLoadercan hit a UAF when it deletes itself before completingNodeStreamLoader::NotifyReadable, so refactor to avoid that possibility.Test added as a separate commit first to show the ASan failure flagging the UAF: https://github.com/electron/electron/actions/runs/30314440929/job/90138979629
Also added tests for two other edge cases which get fixed by the refactor, which would cause the streaming response to stall out: https://github.com/electron/electron/actions/runs/30321732441/job/90160483107
Checklist
npm testpassesRelease Notes
Notes: Fixed a UAF with
protocol.registerStreamProtocolwhen an error is emitted during a read