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.
Published: 2026-02-06
Score: 10 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Sandbox Escape
Action: Patch
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Wed, 18 Feb 2026 14:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:nyariv:sandboxjs:*:*:*:*:*:node.js:*:*

Mon, 09 Feb 2026 11:00:00 +0000

Type Values Removed Values Added
First Time appeared Nyariv
Nyariv sandboxjs
Vendors & Products Nyariv
Nyariv sandboxjs

Fri, 06 Feb 2026 21:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 06 Feb 2026 20:00:00 +0000

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'}


Subscriptions

Nyariv Sandboxjs
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-02-06T20:20:03.764Z

Reserved: 2026-02-04T05:15:41.791Z

Link: CVE-2026-25641

cve-icon Vulnrichment

Updated: 2026-02-06T20:19:51.117Z

cve-icon NVD

Status : Analyzed

Published: 2026-02-06T20:16:11.263

Modified: 2026-02-18T14:01:02.337

Link: CVE-2026-25641

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-17T22:30:29Z

Weaknesses