vm: fix property queries for proxy sandboxes#63742
Open
brianathere wants to merge 1 commit into
Open
Conversation
Signed-off-by: Brian Meek <55990082+brianathere@users.noreply.github.com>
legendecas
reviewed
Jun 4, 2026
|
|
||
| Maybe<bool> maybe_has = sandbox->HasRealNamedProperty(context, property); | ||
| Maybe<bool> maybe_has = | ||
| GetOwnPropertyAttributes(isolate, context, sandbox, property, &attr); |
Member
There was a problem hiding this comment.
I think we can call sandbox->HasOwnProperty for own existence check, and next when the sandbox has the own property, call sandbox->GetPropertyAttributes for property attributes, this could be a fix with just 2 lines.
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: #63739
Refs: #63549
This updates the vm contextify named property query path to inspect own property descriptors on the sandbox object instead of using
HasRealNamedProperty()for that sandbox lookup. The previous lookup cannot see properties through a JSProxy, which made Proxy-backed vm sandboxes report false forhasOwnProperty,Object.hasOwn,in, andReflect.haseven when the property was readable, listed, and had an own descriptor.The fallback lookup on the real global proxy remains unchanged for properties that are not own properties of the sandbox.
Added a regression test for a Proxy sandbox with writable, non-enumerable, and readonly own properties, plus prototype fallback sanity checks.
Validation:
./configure --ninja --without-npm --without-inspector --without-sqlite --without-ffi --without-liefninja -C out/Release -j12 node./out/Release/node test/parallel/test-vm-proxy-sandbox-property-query.jspython3 tools/test.py -J --mode=release parallel/test-vm-proxy-sandbox-property-query parallel/test-vm-property-definer-interception parallel/test-vm-global-property-interceptorsmake lint-cppmake lint-js LINT_JS_TARGETS=test/parallel/test-vm-proxy-sandbox-property-query.js