-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The PoC is six lines\n\nThe advisory ships a proof of concept. It is six lines.\n\n```javascript\nconst g = ({}).__lookupGetter__;\nconst a = Buffer.apply;\nconst p = a.apply(g, [Buffer, ['__proto__']]);\nconst hostObjectProto = p.call(p.call(p.call(p.call(Buffer.of()))));\nhostObjectProto.vm2EscapeMarker = 'polluted-object-prototype';\n```\n\nLine 1 captures `__lookupGetter__` off a plain object literal. That method is on `Object.prototype`, and the sandbox sees the sandbox copy of `Object.prototype`. Line 2 captures `Buffer.apply`. `Buffer` is a host-backed object exposed to the sandbox; `apply` is on `Function.prototype` and the bridge proxies it. Line 3 uses `apply.apply` to call `__lookupGetter__` with `Buffer` as the `this` argument and the string `'__proto__'` as the argument list. The bridge unwraps the host `Buffer`, runs `__lookupGetter__` over the chain that starts from the host side, and hands back the host-side getter for `__proto__`.\n\nThat getter is now in the sandbox. It is a host function. It returns the `[[Prototype]]` of whatever it is called on, evaluated host-side.\n\nLine 4 calls it four times. Each call walks one step up the host prototype chain. `Buffer.of()` returns a host `Buffer`; `p.call(buf)` returns `Uint8Array.prototype`; the next call returns the `TypedArray` abstract prototype; the next returns `Object.prototype`. The variable `hostObjectProto` is bound to the host `Object.prototype`. Line 6 writes a property to it.\n\nWhen line 6 runs, the bridge's `set` trap fires. The bridge has four write traps. They all forward.\n\n## The four traps\n\nThe vm2 bridge installs a `Proxy` around every host object the sandbox sees. The proxy has handlers for `get`, `getOwnPropertyDescriptor`, `has`, `set`, `defineProperty`, `deleteProperty`, `preventExtensions`, and a handful of others. Four of these mutate the host:\n\n- `set` runs assignment, e.g. `obj.x = 1`.\n- `defineProperty` runs `Object.defineProperty(obj, 'x', desc)`.\n- `deleteProperty` runs `delete obj.x`.\n- `preventExtensions` runs `Object.preventExtensions(obj)`.\n\nIn the bridge, each of these four ends in a call to a `Reflect` method captured at bridge init time off the host realm. The captured names are `otherReflectSet`, `otherReflectDefineProperty`, `otherReflectDeleteProperty`, `otherReflectPreventExtensions`. Capture happens once, before sandbox code runs, on the host side, so the sandbox cannot tamper with what those bindings resolve to. The reasoning is sound. The behavior is the bug.\n\nHere is the `set` trap before the fix, with the unwrap step inlined:\n\n```javascript\nset(object, key, value, receiver) {\n // ...key translation, receiver translation...\n value = otherFromThis(value);\n return otherReflectSet(object, key, value) === true;\n}\n```\n\n`object` is the host object. `value` is unwrapped from sandbox to host. `otherReflectSet` is the host's `Reflect.set`. The bridge calls it. The host runs it. If `object` is `Object.prototype`, the host's `Object.prototype` gains a property.\n\nSubstitute `Reflect.defineProperty`, `Reflect.deleteProperty`, `Reflect.preventExtensions` and you have the other three traps. All four forwarded. The advisory's six-line PoC only exercises `set`; the test suite written against the fix exercises all four against `Object.prototype`, `Array.prototype`, `Function.prototype`, and the constructors `Object`, `Array`, `Function`, `String`, `Number`, `Boolean`, `Promise`, `Map`, `Set`, `RegExp`, `Symbol`, plus the error-family prototypes including `AggregateError.prototype`.\n\nThe bridge had no notion that \"writing to `Object.prototype` from the sandbox\" should be different from \"writing to a regular host object from the sandbox.\" Both went through the same trap. Both forwarded.\n\n## The fix\n\nThe fix lives in `lib/bridge.js`. It is a deny list at the trap entry. At bridge construction time, the bridge collects every prototype it considers an intrinsic of the host realm and stores them in a `WeakMap`:\n\n```javascript\nconst protectedHostObjects = new WeakMap();\nfunction markProtected(obj) {\n if (obj == null) return;\n protectedHostObjects.set(obj, true);\n}\nfor (const proto of otherGlobalPrototypes) {\n markProtected(proto);\n markProtected(proto && proto.constructor);\n}\n```\n\n`otherGlobalPrototypes` is the host-side resolution of two arrays, `globalsList` and `errorsList`, which name the intrinsics the bridge wants to protect. `globalsList` includes `Number`, `String`, `Boolean`, `Array`, `Function`, `Object`, `Promise`, `Map`, `Set`, `RegExp`, `Symbol`, and a handful more. `errorsList` includes `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`, `EvalError`, `Error`, and `AggregateError`. The deny list is the union of those prototypes and their `.constructor` properties.\n\nEach of the four write traps now begins with the same guard. Here is `set`:\n\n```javascript\nset(object, key, value, receiver) {\n if (isProtectedHostObject(object)) throw new VMError(OPNA);\n // ...rest of trap unchanged...\n}\n```\n\n`OPNA` is the bridge's string constant for \"operation not allowed.\" `isProtectedHostObject` is a thin wrapper over `protectedHostObjects.has`. The same guard prefix appears on `defineProperty`, `deleteProperty`, and `preventExtensions`. The forwarder still forwards; for one set of targets, it refuses first.\n\nThe body of the trap was not changed. The deny list was added. This is a difference worth holding on to.\n\n## What stays the same\n\nThe descriptor chain in the PoC is unchanged.\n\n`__lookupGetter__` is still callable through the bridge. The sandbox can still capture `({}).__lookupGetter__` and pass it through `apply.apply` to extract host getters. The walk from `Buffer.of()` up to `Object.prototype` still completes. After the fix, `hostObjectProto` is still bound to the host `Object.prototype`. The sandbox holds a reference to a host intrinsic. Reading from it works. Reading its properties works. Calling its methods, where they are host-side functions, works.\n\nWhat does not work is the sixth line. `hostObjectProto.vm2EscapeMarker = 'polluted-object-prototype'` now throws `VMError: Operation not allowed on contextified object.`\n\nSo the post-fix bridge has these properties:\n\n- The sandbox can still obtain references to host intrinsic prototypes.\n- The bridge will refuse to forward writes from the sandbox to those references.\n- The list of \"those references\" is fixed at bridge construction time.\n\nAny host intrinsic the deny list does not name is not protected. The list is curated by hand. The 3.11.0 changelog and the subsequent defense-in-depth commit on 2026-04-30 record AggregateError being added to `errorsList` to close a \"doc drift\" gap. The shape of that fix tells you the shape of the gap: the guard works for every prototype the list names, and only those.\n\n## The CVE is a property of the bridge\n\nThe technical pattern under this CVE is on the catalog as `unpatchable-primitive`. The pattern says: some classes of bug are not removable from a design because the design's value depends on the primitive that makes them possible. vm2's value is forwarding. The bridge exists so that sandbox code can interact with host objects without the sandbox running host code directly. Every host object the sandbox touches passes through it. Every operation the sandbox runs on a host object resolves to a `Reflect` call on the host side.\n\nIf the bridge stopped forwarding writes, vm2 would stop being a sandbox-with-shared-state and become a sandbox-with-isolated-state. That is a different product. The product that was shipped forwards writes. CVE-2026-44005 is what happens when the forwarder is asked to forward a write to `Object.prototype` and complies.\n\nThe deny list does not change the design. It curates the set of targets at which the design declines to operate. New intrinsics that ECMAScript adds (TC39 just landed `Iterator.prototype` improvements; `AsyncIterator.prototype` is a stage-4 candidate) will need to be added to the list by hand. The list is the patch. The patch is the list.\n\n## Write-side vs read-side\n\nThis blog has covered the vm2 sandbox-escape family before. Every prior post was about the read side: how sandbox code can observe host state it should not see, or how host errors leak host-side stack frames or carry host references back through the bridge into sandbox scope. Read-side bugs let the sandbox learn about the host. Write-side bugs let the sandbox change the host.\n\n| CVE | Direction | Primitive |\n|--------------------|-----------|-----------------------------------------------------------------------|\n| CVE-2026-24118 | read | `Promise[Symbol.species]` resolves to a host `Promise` after reset |\n| CVE-2026-24120 | read | README hands the attacker the sandbox-escape recipe |\n| CVE-2026-26332 | read | `SuppressedError` carries a V8-thrown host reference |\n| CVE-2026-26956 | read | JSTag try-table is bytecode-level frame manipulation |\n| CVE-2026-45411 | read | async generator surfaces a host `RangeError` |\n| CVE-2026-44007 | read | README is the patch for the rest |\n| **CVE-2026-44005** | **write** | **four mutation traps forwarded sandbox writes to host intrinsics** |\n\nThe write-side has the same source as the read-side: the bridge is the API the sandbox uses to reach the host, and the bridge translates faithfully. The defense in both cases is the deny list. On the read-side the bridge wraps return values so host references arrive sandbox-shaped. On the write-side the bridge refuses to forward mutation onto a curated set of targets.\n\nThe bridge is not a security boundary. The bridge is the API across the boundary. The deny list is where the security boundary lives. Each item on the list is a piece of security knowledge encoded as data, not as code. That is why the list grows over time and why the changelog mentions a 3.11.0 coordinated release closing thirteen advisories at once.\n\n## The dates\n\nThe CVE record carries a 2026-05-13 publication date. The fix shipped in vm2 3.11.0, attributed to GHSA-vwrp-x96c-mhwq in the changelog under \"coordinated security release closing 13 advisories.\" The defense-in-depth commit that added `AggregateError` to the errors list landed 2026-04-30, two weeks before the CVE was published.\n\nThis is the normal pattern for coordinated disclosure where the registry catches up to the package. The fix is older than the CVE. The advisory got a number after the package shipped the deny list. Reading the timeline strictly: the 3.11.0 release made the PoC fail; the CVE record was filed to give downstream consumers a number to pin. The PoC in the advisory is the test the maintainers wanted to fail. The deny list is the reason it does.\n\nThe other pattern this post sits inside is `the-detector-is-the-target`. vm2 is a sandbox. Its role is to detect, at the boundary, whether sandbox code is about to do something the host has not authorized. When that detection logic is itself an attack surface, you cannot remove the role and keep the product. The bridge is the detector and the target at once. The deny list is a way of writing detection rules without removing the role.\n\n## What 3.11.0 actually shipped\n\nThe 3.11.0 release is a coordinated batch. The changelog entry for GHSA-vwrp-x96c-mhwq reads, in part: \"Add deny list of host intrinsic prototypes; refuse mutation traps on those targets.\" Four traps were touched. One WeakMap was added. The lists that feed the WeakMap were already present in the bridge for use elsewhere; they were promoted from \"intrinsics we know about\" to \"intrinsics we refuse to mutate from sandbox.\"\n\nRead the diff and the surface area is small. Read the test suite the release shipped with and the surface area is the cross product: every name in `globalsList` plus every name in `errorsList`, against `set`, `defineProperty`, `deleteProperty`, `preventExtensions`. The advisory's six-line PoC is the first row of that matrix. The other rows had to be added by hand by people who knew which mutation traps existed and which intrinsics were reachable through `__lookupGetter__`.\n\nThe patch is six lines of guard plus one WeakMap plus one initializer loop. The knowledge encoded in the patch is the union of two lists curated since 2019. That knowledge is the only thing standing between the bridge and `Object.prototype`. The bridge is still a forwarder.\n\nFor prior coverage of the read-side of this family, see [/posts/vm2-cve-2026-24118-resetpromisespecies-has-a-sibling](/posts/vm2-cve-2026-24118-resetpromisespecies-has-a-sibling), [/posts/vm2-cve-2026-24120-readme-already-admits](/posts/vm2-cve-2026-24120-readme-already-admits), [/posts/vm2-suppressederror-carries-what-v8-threw](/posts/vm2-suppressederror-carries-what-v8-threw), [/posts/vm2-jstag-trytable-is-bytecode](/posts/vm2-jstag-trytable-is-bytecode), [/posts/vm2-cve-2026-45411-async-generator-bisects-host-rangeerror](/posts/vm2-cve-2026-45411-async-generator-bisects-host-rangeerror), and [/posts/vm2-cve-2026-44007-readme-is-the-patch-for-the-rest](/posts/vm2-cve-2026-44007-readme-is-the-patch-for-the-rest). The pattern catalog entries are [/patterns/unpatchable-primitive](/patterns/unpatchable-primitive) and [/patterns/the-detector-is-the-target](/patterns/the-detector-is-the-target).","closing_line":"The CVE names a property of the bridge. The patch adds a list of objects to which the property does not apply. The property is the bridge's design.","hook_md":"vm2's bridge is, by design, a forwarder. Sandbox code reaches a host object; the bridge translates the operation; the host runs it. CVE-2026-44005 says that for write operations on intrinsic prototypes, the bridge translated faithfully and the host ran the write. The patch did not stop forwarding. It added a list of objects to which forwarding does not apply.","post_id":345,"slug":"vm2-cve-2026-44005-bridge-forwarded-the-write","title":"CVE-2026-44005: vm2's Bridge Has Four Write Traps. They All Forwarded.","type":"initial","unreadable_sentence":"The CVE names a property of the bridge as a vulnerability; the patch does not remove the property; the patch adds a list of objects to which the property does not apply."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCajbMHgAKCRDeZjl4jgkQ JsMnAQDBBT6tr4wS0y24Yf+jRNUcNyUBD9USY6y7wFOloEHWBAD/Y7GmtkSqr2Aj jxRt5/ItAS2iOmb07jlNqmv7/0hFzQg= =mIub -----END PGP SIGNATURE-----