Critical severityOSV Advisory· Published Feb 2, 2026· Updated Feb 4, 2026
SandboxJS Prototype Pollution -> Sandbox Escape -> RCE
CVE-2026-25142
Description
SandboxJS is a JavaScript sandboxing library. Prior to 0.8.27, SanboxJS does not properly restrict __lookupGetter__ which can be used to obtain prototypes, which can be used for escaping the sandbox / remote code execution. This vulnerability is fixed in 0.8.27.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
@nyariv/sandboxjsnpm | < 0.8.27 | 0.8.27 |
Affected products
1Patches
175c8009db32efix(security): harden sandbox against code execution bypass (GHSA-9p4w-fq8m-2hp7)
3 files changed · +14 −2
package.json+1 −1 modified@@ -1,6 +1,6 @@ { "name": "@nyariv/sandboxjs", - "version": "0.8.26", + "version": "0.8.27", "description": "Javascript sandboxing library.", "main": "dist/node/Sandbox.js", "module": "./build/Sandbox.js",
src/executor.ts+3 −1 modified@@ -377,7 +377,9 @@ addOps(LispType.Prop, (exec, done, ticks, a, b: string, obj, context, scope) => throw new SandboxError(`Static method or property access not permitted: ${a.name}.${b}`); } } - } else if (b !== 'constructor') { + } + + if (b !== 'constructor') { let prot = a; while ((prot = Object.getPrototypeOf(prot))) { if (prot.hasOwnProperty(b)) {
test/tests.json+10 −0 modified@@ -230,6 +230,16 @@ "evalExpect": "error", "safeExpect": "/Method or property access not permitted/" }, + { + "code": "(() => {}).__defineGetter__('a', () => 1 ) || 'ok'", + "evalExpect": "error", + "safeExpect": "/Method or property access not permitted/" + }, + { + "code": "({}).toString.__defineGetter__('a', () => 1 ) || 'ok'", + "evalExpect": "error", + "safeExpect": "/Method or property access not permitted/" + }, { "code": "!test2", "evalExpect": false,
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-9p4w-fq8m-2hp7ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-25142ghsaADVISORY
- github.com/nyariv/SandboxJS/blob/f212a38fb5a6d4bc2bc2e2466c0c011ce8d41072/src/executor.tsghsax_refsource_MISCWEB
- github.com/nyariv/SandboxJS/commit/75c8009db32e6829b0ad92ca13bf458178442bd3ghsax_refsource_MISCWEB
- github.com/nyariv/SandboxJS/security/advisories/GHSA-9p4w-fq8m-2hp7ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.