CVE-2026-23830: @nyariv/sandboxjs SandboxJS Has Sandbox Escape Vulnerability
CRITICALCVE-2026-23830 is a CRITICAL (CVSS 10.0) sandboxjs has sandbox escape vulnerability (CWE-693: Protection Mechanism Failure) affecting @nyariv/sandboxjs libraries in the npm ecosystem. The issue involves sandboxjs has sandbox escape via unprotected asyncfunction constructor. Remediation is available by upgrading affected packages to version 0.8.26.
CVE-2026-23830 at a Glance
Security Impact
CVSS: 10.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-23830
To remediate this vulnerability, upgrade all affected @nyariv/sandboxjs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @nyariv/sandboxjs@0.8.26
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @nyariv/sandboxjs
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-23830, inspect your project dependencies using npm:
npm ls @nyariv/sandboxjs
Analyze the terminal output to locate any version of @nyariv/sandboxjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.26), your application is affected.
Note: The npm ls @nyariv/sandboxjs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. In @nyariv/sandboxjs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-23830 Affected @nyariv/sandboxjs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@nyariv/sandboxjs
|
npm |
< 0.8.26
|
0.8.26
|
References
Frequently Asked Questions
What is CVE-2026-23830?
Which @nyariv/sandboxjs versions are affected?
What version fixes CVE-2026-23830?
Is @nyariv/sandboxjs affected?
What is the CVSS score of CVE-2026-23830?
What CWE is associated with CVE-2026-23830?
How can I check npm dependencies for CVE-2026-23830?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wxhw-j4hc-fmq6",
"modified" : "2026-01-29T03:43:42Z",
"published" : "2026-01-27T19:55:11Z",
"aliases" : [ "CVE-2026-23830" ],
"summary" : "SandboxJS has Sandbox Escape via Unprotected AsyncFunction Constructor",
"details" : "### Summary\nA sandbox escape vulnerability due to `AsyncFunction` not being isolated in `SandboxFunction`\n\n### Details\n\nThe library attempts to sandbox code execution by replacing the global `Function` constructor with a safe, sandboxed version (`SandboxFunction`). This is handled in `utils.ts` by mapping `Function` to `sandboxFunction` within a map used for lookups.\n\nHowever, the library did not include mappings for `AsyncFunction`, `GeneratorFunction`, and `AsyncGeneratorFunction`. These constructors are not global properties but can be accessed via the `.constructor` property of an instance (e.g., `(async () => {}).constructor`).\n\nIn `executor.ts`, property access is handled. When code running inside the sandbox accesses `.constructor` on an async function (which the sandbox allows creating), the `executor` retrieves the property value. Since `AsyncFunction` was not in the safe-replacement map, the `executor` returns the actual native host `AsyncFunction` constructor.\n\nConstructors for functions in JavaScript (like `Function`, `AsyncFunction`) create functions that execute in the global scope. By obtaining the host `AsyncFunction` constructor, an attacker can create a new async function that executes entirely outside the sandbox context, bypassing all restrictions and gaining full access to the host environment (Remote Code Execution).\n\n### PoC\n\n```js\nconst sandbox = require('@nyariv/sandboxjs');\nconst s = new sandbox.default();\n\nconst payload = `\n const af = async () => {};\n // .constructor returns the host AsyncFunction constructor because it's not intercepted\n const AsyncConstructor = af.constructor;\n console.log(\"AsyncConstructor name:\", AsyncConstructor.name);\n \n // Create a function that executes outside the sandbox\n const func = AsyncConstructor(\"return process.mainModule.require('child_process').execSync('id').toString()\");\n \n // Execute RCE\n const p = func();\n p.then(proc => {\n console.log(proc);\n });\n`;\n\ntry {\n s.compile(payload)().run();\n} catch (e) {\n console.error(\"Bypass failed:\", e.message);\n}\n```\n\nRun above script in nodejs. If you run it in browser, change the `AsyncConstructor` argument by returning `window` object. \n\n### Impact\n\nA Remote Code Execution, attacker may be able to run an arbitrary code.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@nyariv/sandboxjs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.8.26"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nyariv/SandboxJS/security/advisories/GHSA-wxhw-j4hc-fmq6"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-23830"
}, {
"type" : "WEB",
"url" : "https://github.com/nyariv/SandboxJS/commit/345aee6566e47979dee5c337b925b141e7f78ccd"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nyariv/SandboxJS"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-693", "CWE-913", "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-01-27T19:55:11Z",
"nvd_published_at" : "2026-01-28T00:15:50Z"
}
}