You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vm: exceptions from getters defined on contextified globalThis are swallowed #66607
How often does it reproduce? Is there a required condition?
The example produced the same output in five runs on each tested version. The getter is defined inside the VM context, directly on globalThis.
What is the expected behavior? Why is that the expected behavior?
Reading the property should propagate the error thrown by its getter to the surrounding catch. The result should contain caught: true and message: "getter failure", rather than treating the read as successful and returning undefined.
This is what happens with vm.constants.DONT_CONTEXTIFY on all three tested versions. The default context also catches the exception on v26.2.0.
The script uses String() to make an undefined result visible in the JSON output.
Node
V8
Default context catches exception
Getter calls in default context
v26.2.0
14.6.202.34-node.20
Yes
3
v26.9.0
14.6.202.34-node.32
No
1
v26.11.1
14.6.202.34-node.37
No
1
With DONT_CONTEXTIFY, the exception is caught and the getter runs once on all three versions.
Additional information
#63549 may be related, but no bisect has been performed and the first affected release has not been identified. This report concerns explicit getter reads, rather than the Proxy property-query issue addressed by #63742.
Root cause is in ContextifyContext::PropertyGetterCallback (src/node_contextify.cc:557). When a getter defined on the sandbox throws, both GetRealNamedProperty calls come back empty, and the function falls through to return Intercepted::kNo at :592 without rethrowing. The try_catch.ReThrow() at :583 only runs in the success branch, so the TryCatchScope destructor swallows the exception and V8 returns undefined instead of propagating the throw.
Fix: rethrow before the kNo return when try_catch.HasCaught(). I can open a PR with that plus a regression test if a maintainer wants it.
Activity
bunnysayzz commentedon Oct 8, 2026
Root cause is in
ContextifyContext::PropertyGetterCallback(src/node_contextify.cc:557). When a getter defined on the sandbox throws, bothGetRealNamedPropertycalls come back empty, and the function falls through toreturn Intercepted::kNoat :592 without rethrowing. Thetry_catch.ReThrow()at :583 only runs in the success branch, so theTryCatchScopedestructor swallows the exception and V8 returnsundefinedinstead of propagating the throw.Fix: rethrow before the
kNoreturn whentry_catch.HasCaught(). I can open a PR with that plus a regression test if a maintainer wants it.naugtur commentedon Oct 8, 2026
LavaMoat tests are also failing on this. (LavaMoat itself works, but is impossible to test with the existing harness)