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
fix(runtime): a sandboxed hook body no longer launders an untouched readonly field onto the row (#15411)
* fix(runtime): compare the entry snapshot as the VM saw it in the write-back key set
Leg 2 of `carriedInputKeys` decides "did the body write THROUGH this
object-valued key?" by comparing the host entry snapshot against the VM's
exit dump. The dump is JSON; the snapshot was not. A host `Date` therefore
compared unequal to its own ISO projection, was carried back onto the
engine's flat-input Proxy, recorded by the #14088 `set` trap as hook-written,
and kept by `stripReadonlyFields` — a caller-supplied readonly field no hook
ever touched landing on the row.
Normalise the entry value through the same round-trip the VM saw before
comparing. The #14758 fail-open is preserved per key: a value the round-trip
cannot evaluate (cycle, bigint) is still reported as changed and carried.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* test(runtime): pin that an untouched readonly key is not laundered by the sandbox write-back
Eight cases over the same line. Five drive real ObjectQL + real SqlDriver +
real QuickJSScriptRunner: the readonly `Date` on both strip sites, the wider
`json`-with-an-undefined-member case, and two controls that stop a green from
being vacuous — a body that DOES assign the readonly key still lands its
write, and a body that mutates a readonly object in place is still carried by
leg 2. Three read the same line at the write-back boundary, where the driver
cannot normalise the evidence away: an untouched host `Date` and an untouched
object keep their identity, and a cyclic entry value is still carried, which
is #14758's fail-open unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments