Skip to main content
Mallory

SandboxJS Sandbox Escape via Host Prototype Pollution (CVE-2026-25881)

proof-of-concept-releaseopen-source-dependency-vulnerabilitywidely-deployed-product-advisory
Updated March 21, 2026 at 02:34 PM2 sources
Share:
SandboxJS Sandbox Escape via Host Prototype Pollution (CVE-2026-25881)

Get Ahead of Threats Like This

Know if you're exposed. Before adversaries strike.

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.

Timeline

  1. Feb 11, 2026

    Researcher publishes PoC for SandboxJS host takeover scenarios

    A researcher identified as k14uz released a working proof of concept showing persistent prototype modification, overwriting built-ins, and command execution when polluted properties are later used by the host. The PoC publicized practical exploitation paths for CVE-2026-25881.

  2. Feb 9, 2026

    SandboxJS 0.8.31 released to fix CVE-2026-25881

    The issue was fixed in SandboxJS version 0.8.31, with upstream references including a security advisory and a fixing commit. Users were advised to upgrade from affected versions up to 0.8.30.

  3. Feb 9, 2026

    SandboxJS prototype pollution sandbox escape is disclosed as CVE-2026-25881

    A vulnerability affecting SandboxJS versions before 0.8.31 was disclosed as CVE-2026-25881. The flaw allows sandboxed code to mutate host built-in prototypes through an array intermediary, creating persistent host-side prototype pollution and possible remote code execution in vulnerable host applications.

See the full picture in Mallory

Mallory subscribers get deeper analysis on every story, including:

Impact Assessment

Who’s affected and how

Technical Details

Deep-dive technical analysis

Response Recommendations

Actionable next steps for your team

Indicators of Compromise

IPs, domains, hashes, and more

AI Threads

Ask questions and take action on every story

Advanced Filters

Filter by topic, classification, timeframe

Scheduled Alerts

Get matching stories delivered automatically

Related Stories

Critical SandboxJS Sandbox-Escape Vulnerabilities Enabling Host Code Execution

Critical SandboxJS Sandbox-Escape Vulnerabilities Enabling Host Code Execution

Multiple **critical vulnerabilities in *SandboxJS***—a JavaScript sandboxing library used to run untrusted code—were disclosed as enabling **sandbox escape and arbitrary code execution on the host**, with several issues scored **CVSS 10.0**. Reported flaws include **CVE-2026-25520**, **CVE-2026-25586**, **CVE-2026-25587**, and **CVE-2026-25641**, described as providing multiple paths to break out of SandboxJS’s isolation guarantees and take over the underlying runtime environment. Technical details published for **CVE-2026-25520** indicate that, prior to *SandboxJS* `0.8.29`, **function return values are not wrapped**, allowing attackers to use `Object.values()`/`Object.entries()` to obtain an array containing the host’s `Function` constructor (e.g., via `Array.prototype.at`), which can then be used to execute code outside the sandbox; the issue is fixed in `0.8.29` (with a referenced upstream commit and GitHub Security Advisory). Additional reported escape vectors include manipulation of supposedly safe prototypes (e.g., overwriting `Map.prototype.has` via a bug in the library’s `let` implementation) and a **host prototype pollution** condition tied to unsafe property-checking logic, collectively undermining the library’s core containment model.

1 months ago
SandboxJS Sandbox Escape via Unprotected AsyncFunction Constructor (CVE-2026-23830)

SandboxJS Sandbox Escape via Unprotected AsyncFunction Constructor (CVE-2026-23830)

**CVE-2026-23830** is a maximum-severity (**CVSS 10.0**) sandbox-escape vulnerability in *SandboxJS*, a library intended to safely execute untrusted JavaScript. The issue allows attackers to break out of the sandbox and achieve **arbitrary code execution on the host** by leveraging gaps in SandboxJS’s “safe replacement” model for dangerous constructors. The flaw stems from SandboxJS mapping the global `Function` constructor to a sandboxed equivalent, but (in affected versions) failing to similarly isolate the “Async” and generator constructor families: `AsyncFunction`, `GeneratorFunction`, and `AsyncGeneratorFunction`. Although these constructors are not directly exposed as globals, they can be obtained via an instance’s `.constructor` (e.g., `(async () => {}).constructor`); because the executor returns the **native host** `AsyncFunction` when it is not present in the safe-replacement map, an attacker can create new functions that execute in the global scope and bypass sandbox restrictions. *SandboxJS* **0.8.26** is reported as the patched version.

1 months ago
JavaScript Library Flaws Enable Sandbox Escape and Code Execution

JavaScript Library Flaws Enable Sandbox Escape and Code Execution

Two high-severity flaws were disclosed in widely used JavaScript libraries, exposing applications to sandbox bypass and arbitrary code execution. **CVE-2026-34208** affects SandboxJS before `0.8.36` and allows attacker-supplied code to evade protections on direct assignment to global objects by abusing an exposed constructor path. The bypass uses `this.constructor.call(target, attackerObject)` to reach the internal `SandboxGlobal` function while `Function.prototype.call` remains permitted, enabling arbitrary properties to be written into host global objects and persist across sandbox instances in the same process. A separate issue, **CVE-2026-41242**, impacts `protobufjs` before `8.0.1` and `7.5.5`, where attackers can inject arbitrary code into Protocol Buffers definition `type` fields and trigger execution during object decoding with a malicious schema. The flaw is tracked as **CWE-94** and carries a CVSS v4 rating reflecting network-reachable exploitation with high impact to confidentiality, integrity, availability, and downstream systems. Maintainers released fixes in SandboxJS `0.8.36` and protobufjs `8.0.1` and `7.5.5`.

2 weeks ago

Get Ahead of Threats Like This

Mallory continuously monitors global threat intelligence and correlates it with your attack surface. Know if you're exposed. Before adversaries strike.

SandboxJS Sandbox Escape via Host Prototype Pollution (CVE-2026-25881) | Mallory