CVE-2026-25641

SandboxJS has a sandbox escape via TOCTOU bug on keys in property accesses

Published Feb 6, 2026 CVSS 3.1 · 10 Critical EPSS < 1% KEV · Not listed
Description
SandboxJS is a JavaScript sandboxing library. Prior to 0.8.29, there is a sandbox escape vulnerability due to a mismatch between the key on which the validation is performed and the key used for accessing properties. Even though the key used in property accesses is annotated as string, this is never enforced. So, attackers can pass malicious objects that coerce to different string values when used, e.g., one for the time the key is sanitized using hasOwnProperty(key) and a different one for when the key is used for the actual property access. This vulnerability is fixed in 0.8.29.

Analysis

AI-generated

Technical impact

This vulnerability is a TOCTOU race condition in the property access validation of SandboxJS. When the library checks if a key exists using hasOwnProperty, it uses one value, but when actually accessing the property it uses another value derived from the supplied input. Because keys that are strings are not strictly enforced, an attacker can supply an object that coerces to two distinct string values, causing the sandbox check to pass while the subsequent property read occurs outside of the intended sandbox. The result is a sandbox escape that may allow an attacker to execute arbitrary code in the host environment, effectively providing full control over the process. The flaw is a classic example of the time‑of‑check to time‑of‑use race condition (CWE‑367).

Affected Systems

The affected product is SandboxJS by nyariv. Any deployment that uses a version older than 0.8.29 is vulnerable. The library runs within Node.js applications, so the risk applies to any JavaScript runtime that incorporates this dependency. No specific operating system is mentioned; the impact is confined to the JavaScript execution environment.

Risk and Exploitability

The CVSS base score is 10, indicating a potentially complete compromise of the host process if exploited. The EPSS score is currently below 1 %, suggesting that successful exploitation is unlikely at present. The vulnerability is not listed in CISA's KEV catalog, indicating no documented widespread exploitation. Attackers would need to provide crafted JavaScript objects that coerce to different string values to trigger the TOCTOU. Once the sandbox boundary is bypassed, the attacker can run arbitrary Node.js code.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade SandboxJS to version 0.8.29 or later, where the key validation and property access are aligned.
  • Reject or whitelist inputs that use non‑string keys; ensure that any object passed to the sandbox cannot coerce to multiple string representations.
  • Wrap property access with a defensive check that uses the same key for both hasOwnProperty and the actual lookup, or enforce strict type validation before performing the lookup.

Generated by OpenCVE AI on April 17, 2026 at 22:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-7x3h-rm86-3342 @nyariv/sandboxjs vulnerable to sandbox escape via TOCTOU bug on keys in property accesses
History
Type Values Removed Values Added
CPEs cpe:2.3:a:nyariv:sandboxjs:*:*:*:*:*:node.js:*:*
Type Values Removed Values Added
First Time appeared Nyariv
Nyariv sandboxjs
Vendors & Products Nyariv
Nyariv sandboxjs
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description SandboxJS is a JavaScript sandboxing library. Prior to 0.8.29, there is a sandbox escape vulnerability due to a mismatch between the key on which the validation is performed and the key used for accessing properties. Even though the key used in property accesses is annotated as string, this is never enforced. So, attackers can pass malicious objects that coerce to different string values when used, e.g., one for the time the key is sanitized using hasOwnProperty(key) and a different one for when the key is used for the actual property access. This vulnerability is fixed in 0.8.29.
Title SandboxJS has a sandbox escape via TOCTOU bug on keys in property accesses
Weaknesses CWE-367
References
Metrics cvssV3_1

{'score': 10, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H'}

Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Feb 6, 2026, 8:20 PM
Reserved
Feb 4, 2026, 5:15 AM
Status
Analyzed
Published
Feb 6, 2026, 8:16 PM
Modified
Jun 17, 2026, 10:24 AM