SandboxJS Sandbox Escape via Host Prototype Pollution (CVE-2026-25881)
Vulnerability Disclosure · 2 sources · Updated 5mo ago · First seen Feb 11, 2026

CVE-2026-25881 is a critical sandbox-escape flaw in SandboxJS (@nyariv/sandboxjs) that allows sandboxed JavaScript to mutate host built-in prototypes (e.g., Map.prototype, Set.prototype) and cause persistent host-side prototype pollution. The issue stems from SandboxJS’s isGlobal protection mechanism: when a global prototype reference is placed into an array literal and then retrieved, the isGlobal “taint” is stripped, enabling direct prototype mutation from within the sandbox. The vulnerability affects versions prior to 0.8.31 and is fixed in 0.8.31; CVSS v3.1 is reported as AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H and the weakness is mapped to CWE-1321.
Public reporting indicates a working proof-of-concept (PoC) is available demonstrating multiple exploitation scenarios, including adding attacker-controlled properties to host prototypes and overwriting built-in functions. While the sandbox escape itself is the core impact, remote code execution is application-dependent: if the host application later uses polluted properties in sensitive sinks (example gadget: execSync(obj.cmd)), an attacker can potentially execute system commands (e.g., id). Organizations using SandboxJS to run untrusted code should prioritize upgrading to 0.8.31 and review host code paths for dangerous use of object properties that could be influenced via prototype pollution.


