Dirty Laundry: Escaping SandboxJS via Array Laundering
Vulnerability ID: CVE-2026-25881
CVSS Score: 9.1
Published: 2026-02-10
A critical sandbox escape vulnerability in @nyariv/sandboxjs allows malicious code to bypass the 'isGlobal' protection flag by laundering host references through array literals. This seemingly innocuous action strips security metadata, granting attackers write access to critical host prototypes (CWE-1321) and leading to potential Remote Code Execution (RCE).
TL;DR
SandboxJS failed to persist security tags when objects were placed into array literals. Attackers could wrap a global object (like Array.prototype) in an array, retrieve it, and receive a 'clean' reference, allowing them to pollute the host environment.
⚠️ Exploit Status: POC
Technical Details
- CWE ID: CWE-1321
- CWE Name: Prototype Pollution
- CVSS Score: 9.1 (Critical)
- Attack Vector: Network (AV:N)
- Exploit Maturity: PoC Available
- Impact: Sandbox Escape / RCE
Affected Systems
- @nyariv/sandboxjs < 0.8.31
-
@nyariv/sandboxjs: < 0.8.31 (Fixed in:
0.8.31)
Code Analysis
Commit: f369f8d
Fix sandbox escape via prototype pollution
function getGlobalProp(val: unknown, context: IExecContext, prop?: Prop) { ... }
Exploit Details
- GitHub Advisory: Official advisory containing PoC details
Mitigation Strategies
- Update @nyariv/sandboxjs to v0.8.31+
- Freeze host prototypes (Object.freeze) prior to sandbox initialization
- Run sandboxed processes in isolated containers/VMs (defense in depth)
Remediation Steps:
- Run
npm auditto identify the vulnerable package. - Execute
npm update @nyariv/sandboxjs. - Verify version is >= 0.8.31 in
package-lock.json.
References
Read the full report for CVE-2026-25881 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)