Use shims to find wrappables - #7164
Merged
sohpeach merged 1 commit intoAug 28, 2026
Merged
Conversation
Contributor
|
I'm Bonk, and I've done a quick review of your PR. PR #7164 replaces raw wrappable pointers with tagged CppGC-shim lookup.
Here's a joke for you: Why did the pointer cross the stream? To get to the other base. |
erikcorry
approved these changes
Aug 28, 2026
sohpeach
force-pushed
the
swallace/patch-wrappable-shims
branch
from
August 28, 2026 09:51
dad5a2f to
5561002
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## swallace/patch-hibernatable-websockets #7164 +/- ##
=======================================================================
Coverage 35.05% 35.05%
=======================================================================
Files 811 811
Lines 258769 258829 +60
Branches 21601 21616 +15
=======================================================================
+ Hits 90701 90735 +34
- Misses 154951 154975 +24
- Partials 13117 13119 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sohpeach
force-pushed
the
swallace/patch-wrappable-shims
branch
from
August 28, 2026 10:55
5561002 to
2f37825
Compare
We previously kept a wrappable alive via the shims in the cppgc heap, but an attacker with an in-sandbox corruption exploit can manipulate the in-sandbox indeces into the cppgc table so that the shims are freed and thus the wrappables, but the JS objects still have a reference to the freed wrappables in the external pointer table. This means an attacker can escalate from an in-sandbox V8 bug to a use-after-free. With this change we access the wrappable from a field in the cppgc shim, thus aligning the lifetimes and closing this avenue. As an extra benefit we tag the entries in the cppgc table with type tags so that we can verify that an in-sandbox corruption is not leading to a type confusion attack. This lines up with the way Chromium does it. We have more tagging bits in the cppgc table than in the external pointer table, which makes this simpler. The aim is that type test failures in the bindings that can be caused by a programmer error should throw, but failing type tests that we think can only be called by in-sandbox corruption/attacks should abort().
sohpeach
force-pushed
the
swallace/patch-wrappable-shims
branch
from
August 28, 2026 11:39
2f37825 to
99e1257
Compare
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.
Merging from upstream.
We previously kept a wrappable alive via the shims in the cppgc heap, but an attacker with an in-sandbox corruption exploit can manipulate the in-sandbox indeces into the cppgc table so that the shims are freed and thus the wrappables, but the JS objects still have a reference to the freed wrappables in the external pointer table. This means an attacker can escalate from an in-sandbox V8 bug to a use-after-free.
With this change we access the wrappable from a field in the cppgc shim, thus aligning the lifetimes and closing this avenue. As an extra benefit we tag the entries in the cppgc table with type tags so that we can verify that an in-sandbox corruption is not leading to a type confusion attack. This lines up with the way Chromium does it. We have more tagging bits in the cppgc table than in the external pointer table, which makes this simpler.
The aim is that type test failures in the bindings that can be caused by a programmer error should throw, but failing type tests that we think can only be called by in-sandbox corruption/attacks should abort().