{"id":"CVE-2026-71866","aliases":["EUVD-2026-62596","GHSA-6mr6-jvcr-2f25","ROOT-APP-NPM-CVE-2026-71866"],"status":"published","title":"Orval: Import-time RCE via schema property name -\u003e computed-property-key injection in the zod client","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. From version 8.19.0 until 8.21.0, a double quote in a schema property name is emitted into the generated zod.object({...}) schema without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated zod schema module is imported, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/zod/src/index.ts and zod object-key generation. This issue is fixed in version 8.21.0.","severity":{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00653,"percentile":0.51572,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-89","CWE-95"],"published":"2026-08-19T17:27:28Z","modified":"2026-10-28T02:30:48Z","fixes":[{"ecosystem":"npm","package":"orval","fixed_in":["8.21.0"],"sources":["ghsa","osv"]},{"ecosystem":"Root:npm","package":"orval","fixed_in":["7.21.0-aikido.4","7.21.0-aikido.5","7.21.0-aikido.1","7.13.2-aikido.2","7.13.2-aikido.1","7.13.2-aikido.3","7.21.0-aikido.2","7.21.0-aikido.3"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"@rootio/orval","fixed_in":["7.21.0-root.io.4","7.21.0-root.io.5","7.21.0-root.io.1","7.13.2-root.io.2","7.13.2-root.io.1","7.13.2-root.io.3","7.21.0-root.io.2","7.21.0-root.io.3"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"orval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.21.0"}]}]},{"source":"osv","ecosystem":"npm","package":"orval","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"8.21.0"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"orval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"7.21.0-aikido.4"},{"fixed":"7.21.0-aikido.5"},{"fixed":"7.21.0-aikido.1"},{"fixed":"7.13.2-aikido.2"},{"fixed":"7.13.2-aikido.1"},{"fixed":"7.13.2-aikido.3"},{"fixed":"7.21.0-aikido.2"},{"fixed":"7.21.0-aikido.3"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/orval","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"7.21.0-root.io.4"},{"fixed":"7.21.0-root.io.5"},{"fixed":"7.21.0-root.io.1"},{"fixed":"7.13.2-root.io.2"},{"fixed":"7.13.2-root.io.1"},{"fixed":"7.13.2-root.io.3"},{"fixed":"7.21.0-root.io.2"},{"fixed":"7.21.0-root.io.3"}]}]}],"products":[{"vendor":"orval-labs","product":"orval"}],"references":[{"url":"https://github.com/orval-labs/orval/security/advisories/GHSA-6mr6-jvcr-2f25","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/orval-labs/orval/pull/3692","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/orval-labs/orval/commit/8ef1bfdf3f9bcaf9dabfbe2e42887f1c0e159ab6","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/orval-labs/orval/releases/tag/v8.21.0","tags":["x_refsource_MISC","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-71866","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-6mr6-jvcr-2f25"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/71xxx/CVE-2026-71866.json","tags":["advisory"]},{"url":"https://github.com/orval-labs/orval","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-71866","title":"Orval: Import-time RCE via schema property name -\u003e computed-property-key injection in the zod client","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. From version 8.19.0 until 8.21.0, a double quote in a schema property name is emitted into the generated zod.object({...}) schema without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated zod schema module is imported, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/zod/src/index.ts and zod object-key generation. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:27:28.222Z","modified":"2026-08-19T18:03:13.73Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical","assessor":"cna"}],"cwes":["CWE-89","CWE-95"],"updated_at":"2026-11-02T14:19:49.559463Z"}],"euvd":[{"id":"EUVD-2026-62596","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. From version 8.19.0 until 8.21.0, a double quote in a schema property name is emitted into the generated zod.object({...}) schema without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated zod schema module is imported, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/zod/src/index.ts and zod object-key generation. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:27:28Z","modified":"2026-08-19T18:03:13Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical"}],"updated_at":"2026-11-02T18:01:41.405951Z"}],"ghsa":[{"id":"GHSA-6mr6-jvcr-2f25","title":"Orval: Import-time RCE via schema property name -\u003e computed-property-key injection in the zod client","description":"### Summary\n\norval's zod client emits each schema property name as a double-quoted key in the generated zod.object({...})\nWITHOUT escaping the double quote. A \" in a property name closes the key and lands in object-literal\ncontext, where an injected computed property key [expr] is evaluated when zod.object({...}) runs -- which\nis at MODULE IMPORT (the `export const X = zod.object({...})` executes on load) -\u003e import-time RCE. The\nproperty name is a pure data field. Verified on orval 8.19.0 / Node. CWE-94 / CWE-95 / CWE-116.\n\n### Details\n\n```ts\nexport const OpBody = zod.object({ \"a\":zod.string(),[require(\"fs\").writeFileSync(\"PWNED\",\"\")]:zod.string(),\"b\": zod.string().optional() })\n```\n\nSibling: the MSW mock uses a single-quoted key (' breakout, call-time) -- separate report. The TS interface\nkey is a type (DoS only). Distinct from orval's $ref / route-path / server-url / zod-default findings.\n\n### PoC\n\nreproduce.sh (+ make_spec.py) attached: a property name a\":zod.string(),[require(\"fs\").writeFileSync(\"\u003cmarker\u003e\",\"\")]:zod.string(),\"b\n-\u003e zod.object; evaluating it (= importing the module) writes the marker. Verified on 8.19.0.\n\n### Impact\n\nJavaScript / OS command execution (via child_process) at import time for anyone who generates an orval zod\nclient from an attacker-controlled spec and imports it. Estimated Critical, e.g.\n`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`.\n\n### Suggested fix\n\nEscape the property name for the JS string key (JSON.stringify) in the zod.object key generation; never\ninterpolate a raw property name adjacent to [ ] in object-literal position.\n[maintainer-report.txt](https://github.com/user-attachments/files/29426038/maintainer-report.txt)\n[make_spec.py](https://github.com/user-attachments/files/29426039/make_spec.py)\n[reproduce.sh](https://github.com/user-attachments/files/29426040/reproduce.sh)","status":"published","published":"2026-09-02T14:52:56Z","modified":"2026-09-02T14:52:58Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical"}],"cwes":["CWE-89","CWE-95"],"updated_at":"2026-11-02T14:41:10.121131Z"}],"nvd":[{"id":"CVE-2026-71866","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. From version 8.19.0 until 8.21.0, a double quote in a schema property name is emitted into the generated zod.object({...}) schema without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated zod schema module is imported, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/zod/src/index.ts and zod object-key generation. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T18:17:23.583Z","modified":"2026-09-09T21:20:38.86Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"critical","assessor":"secondary"}],"cwes":["CWE-89","CWE-95"],"updated_at":"2026-11-02T14:12:39.962615Z"}],"osv":[{"id":"CVE-2026-71866","title":"Orval: Import-time RCE via schema property name -\u003e computed-property-key injection in the zod client","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. From version 8.19.0 until 8.21.0, a double quote in a schema property name is emitted into the generated zod.object({...}) schema without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated zod schema module is imported, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/zod/src/index.ts and zod object-key generation. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:27:28.222Z","modified":"2026-10-28T02:30:48.026897197Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical"}],"cwes":["CWE-89","CWE-95"],"updated_at":"2026-11-02T15:45:15.511448Z"},{"id":"GHSA-6mr6-jvcr-2f25","title":"Orval: Import-time RCE via schema property name -\u003e computed-property-key injection in the zod client","description":"### Summary\n\norval's zod client emits each schema property name as a double-quoted key in the generated zod.object({...})\nWITHOUT escaping the double quote. A \" in a property name closes the key and lands in object-literal\ncontext, where an injected computed property key [expr] is evaluated when zod.object({...}) runs -- which\nis at MODULE IMPORT (the `export const X = zod.object({...})` executes on load) -\u003e import-time RCE. The\nproperty name is a pure data field. Verified on orval 8.19.0 / Node. CWE-94 / CWE-95 / CWE-116.\n\n### Details\n\n```ts\nexport const OpBody = zod.object({ \"a\":zod.string(),[require(\"fs\").writeFileSync(\"PWNED\",\"\")]:zod.string(),\"b\": zod.string().optional() })\n```\n\nSibling: the MSW mock uses a single-quoted key (' breakout, call-time) -- separate report. The TS interface\nkey is a type (DoS only). Distinct from orval's $ref / route-path / server-url / zod-default findings.\n\n### PoC\n\nreproduce.sh (+ make_spec.py) attached: a property name a\":zod.string(),[require(\"fs\").writeFileSync(\"\u003cmarker\u003e\",\"\")]:zod.string(),\"b\n-\u003e zod.object; evaluating it (= importing the module) writes the marker. Verified on 8.19.0.\n\n### Impact\n\nJavaScript / OS command execution (via child_process) at import time for anyone who generates an orval zod\nclient from an attacker-controlled spec and imports it. Estimated Critical, e.g.\n`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`.\n\n### Suggested fix\n\nEscape the property name for the JS string key (JSON.stringify) in the zod.object key generation; never\ninterpolate a raw property name adjacent to [ ] in object-literal position.\n[maintainer-report.txt](https://github.com/user-attachments/files/29426038/maintainer-report.txt)\n[make_spec.py](https://github.com/user-attachments/files/29426039/make_spec.py)\n[reproduce.sh](https://github.com/user-attachments/files/29426040/reproduce.sh)","status":"published","published":"2026-09-02T14:52:56Z","modified":"2026-09-02T15:00:09.98132718Z","cvss":[{"version":"4.0","score":9.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"critical"}],"cwes":["CWE-89","CWE-95"],"updated_at":"2026-11-02T15:46:39.965326Z"},{"id":"ROOT-APP-NPM-CVE-2026-71866","title":"CVE-2026-71866 in orval - Patched by Root","description":"Root has patched CVE-2026-71866 in the orval package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-09-21T06:43:17Z","modified":"2026-09-21T07:15:06.992143154Z","updated_at":"2026-11-02T15:53:27.649662Z"}]}}
