Sandbox Escape TOCTOU in SandboxJS
CVE-2026-25641 is a sandbox escape vulnerability in SandboxJS affecting versions 0.8.28 and earlier. The flaw arises from a mismatch between the property key validated by the sandbox and the key ultimately used for property access. SandboxJS performs a safety check using a key value during validation, but does not enforce that the same primitive string value is later used when the property is accessed. Because the key is only annotated as a string and not strictly enforced as one, an attacker can supply a crafted object whose coercion yields different string values at different moments. This creates a time-of-check to time-of-use condition in which a key can appear benign during validation and resolve to a dangerous property during access, enabling bypass of sandbox restrictions and access to prohibited prototype-related properties.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can break the isolation guarantees of SandboxJS and permit sandbox escape. By bypassing property access restrictions, an attacker may reach dangerous prototype paths and other sensitive language features that are intended to be blocked by the sandbox. In practical terms, this can enable arbitrary code execution in the host context, security policy bypass, and potentially full compromise of the environment executing untrusted JavaScript.
If you can’t patch tonight, do this now.
If immediate patching is not possible, do not execute untrusted code in affected SandboxJS deployments. As a temporary hardening measure, reject non-primitive property keys in sandboxed operations, explicitly deny access to prototype-related properties such as constructor, prototype, and proto, and reduce or remove access paths that could expose powerful built-ins such as Function or host runtime capabilities. These measures are compensating controls only and should not be treated as a substitute for upgrading.
Patch, then assume compromise.
Upgrade SandboxJS to version 0.8.29 or later, which contains the fix for this vulnerability. The underlying issue should be addressed by ensuring that property keys used in security-sensitive validation and subsequent access are canonicalized once and enforced as primitive strings, so the checked value and the used value cannot diverge through coercion side effects.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
9 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.