{"id":"CVE-2026-23830","published":"2026-01-27T23:32:16Z","modified":"2026-01-28T15:09:44Z","title":"SandboxJS has Sandbox Escape via Unprotected AsyncFunction Constructor","vendor":"nyariv","product":"SandboxJS","tier":"tail","description":{"text":"SandboxJS is a JavaScript sandboxing library. Versions prior to 0.8.26 have a sandbox escape vulnerability due to `AsyncFunction` not being isolated in `SandboxFunction`. The 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. However, before version 0.8.26, 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`). In `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. Constructors 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). Version 0.8.26 patches this vulnerability.","provenance":"source","from":"CVE.org"},"cvss":{"score":10,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01219,"percentile":0.69392,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-693","name":"Protection Mechanism Failure"},{"id":"CWE-913","name":"Improper Control of Dynamically-Managed Code Resources"}],"references":[{"url":"https://github.com/nyariv/SandboxJS/security/advisories/GHSA-wxhw-j4hc-fmq6","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/nyariv/SandboxJS/commit/345aee6566e47979dee5c337b925b141e7f78ccd","tags":["x_refsource_MISC"]}],"priority":{"score":25.9,"factors":[{"name":"EPSS percentile","points":13.88},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":7.0}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-01-28","earliestUrl":"https://github.com/Galaxy-sc/CVE-2026-23830-SandBreak","repos":[{"name":"Galaxy-sc/CVE-2026-23830-SandBreak","url":"https://github.com/Galaxy-sc/CVE-2026-23830-SandBreak","stars":1,"created":"2026-01-28"}]},"first":{"date":"2026-01-28","source":"PoC-in-GitHub","url":"https://github.com/Galaxy-sc/CVE-2026-23830-SandBreak"},"provenance":"source"},"vendorSlug":"nyariv","affectedVersions":[{"vendor":"nyariv","product":"SandboxJS","versions":["< 0.8.26"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2026-01-28T15:09:12.332920Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"@nyariv/sandboxjs","vulnerableRanges":["<0.8.26"],"patched":["0.8.26"],"from":["GHSA-wxhw-j4hc-fmq6"],"provenance":"source"}],"summary":{"text":"SandboxJS, a JavaScript sandboxing library by nyariv, has a sandbox escape flaw in its handling of the AsyncFunction, GeneratorFunction, and AsyncGeneratorFunction constructors, which were not replaced with sandboxed versions in releases before 0.8.26. An attacker able to run code inside the sandbox over the network without authentication or user interaction can reach the host AsyncFunction constructor through a .constructor property access on an async function, then use it to execute code outside the sandbox, gaining full access to the host environment.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T05:39:28Z"},"euvd":{"id":"EUVD-2026-4897","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-nyariv-sandboxjs-cve-2026-23830","children":[{"from":"CVE-2026-23830","to":"CVE-2026-25881","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/SandboxExec.ts","src/eval.ts","src/utils.ts"],"commits":["https://github.com/nyariv/SandboxJS/commit/345aee6566e47979dee5c337b925b141e7f78ccd","https://github.com/nyariv/SandboxJS/commit/f369f8db26649f212a6a9a2e7a1624cb2f705b53"],"basis":"rarely changed file"}]},{"from":"CVE-2026-23830","to":"CVE-2026-32723","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/eval.ts"],"commits":["https://github.com/nyariv/SandboxJS/commit/345aee6566e47979dee5c337b925b141e7f78ccd","https://github.com/nyariv/SandboxJS/commit/cc8f20b4928afed5478d5ad3d1737ef2dcfaac29"],"basis":"shared function","functions":["sandboxFunction"]}]},{"from":"CVE-2026-23830","to":"CVE-2026-34217","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/SandboxExec.ts","src/eval.ts","src/utils.ts"],"commits":["https://github.com/nyariv/SandboxJS/commit/345aee6566e47979dee5c337b925b141e7f78ccd","https://github.com/nyariv/SandboxJS/commit/abc02f657279e51a4aaad2bc8f99f3e37a01b287"],"basis":"shared function","functions":["createExecContext","sandboxFunction"]}]}],"packageHistory":[{"cve":"CVE-2025-34146","published":"2025-07-31","fixed":"0.8.24","kev":false,"link":{"from":"CVE-2025-34146","to":"CVE-2026-23830","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:@nyariv/sandboxjs","fromFixed":"0.8.24","toFixed":"0.8.26","daysApart":180}]}},{"cve":"CVE-2026-23830","published":"2026-01-27","fixed":"0.8.26","kev":false},{"cve":"CVE-2026-25142","published":"2026-02-02","fixed":"0.8.27","kev":false,"link":{"from":"CVE-2026-23830","to":"CVE-2026-25142","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:@nyariv/sandboxjs","fromFixed":"0.8.26","toFixed":"0.8.27","daysApart":6}]}},{"cve":"CVE-2026-25520","published":"2026-02-06","fixed":"0.8.29","kev":false},{"cve":"CVE-2026-25586","published":"2026-02-06","fixed":"0.8.29","kev":false}],"package":"npm:@nyariv/sandboxjs"}}