{"id":"CVE-2026-71867","aliases":["EUVD-2026-62607","GHSA-2w86-xfrc-g85r","ROOT-APP-NPM-CVE-2026-71867"],"status":"published","title":"Orval: RCE via schema property name -\u003e computed-property-key injection in the MSW mock generator","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a single quote in a schema property name is emitted into single-quoted object keys in generated MSW mock factories without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated mock factory is called by tests or an MSW handler, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/core/src/getters/keys.ts function getKey and MSW mock 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:38:36Z","modified":"2026-10-28T02:30:31Z","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-2w86-xfrc-g85r","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-71867","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-2w86-xfrc-g85r"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/71xxx/CVE-2026-71867.json","tags":["advisory"]},{"url":"https://github.com/orval-labs/orval","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-71867","title":"Orval: RCE via schema property name -\u003e computed-property-key injection in the MSW mock generator","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a single quote in a schema property name is emitted into single-quoted object keys in generated MSW mock factories without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated mock factory is called by tests or an MSW handler, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/core/src/getters/keys.ts function getKey and MSW mock generation. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:38:36.371Z","modified":"2026-08-19T18:21:51.339Z","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-62607","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a single quote in a schema property name is emitted into single-quoted object keys in generated MSW mock factories without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated mock factory is called by tests or an MSW handler, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/core/src/getters/keys.ts function getKey and MSW mock generation. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:38:36Z","modified":"2026-08-19T18:21:51Z","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:40.9092Z"}],"ghsa":[{"id":"GHSA-2w86-xfrc-g85r","title":"Orval: RCE via schema property name -\u003e computed-property-key injection in the MSW mock generator","description":"### Summary\n\norval, when generating MSW mocks (output.mock: true), emits each schema property name as a single-quoted object key in the mock factory WITHOUT escaping the single quote. A ' in a property name closes the key and lands in object-literal context, where an injected computed property key [expr] is evaluated when the mock factory is called (e.g. in tests / MSW handlers) -\u003e RCE. The property name is a pure data field. Verified on orval 8.19.0 / Node. \n\n### Details\n\n```ts\nexport const getOpResponseMock = (...): Thing =\u003e ({'x': 0, [require(\"fs\").writeFileSync(\"PWNED\",\"\")]: 0, 'y': faker...., ...overrideResponse});\n```\n\nSafe elsewhere: the zod schema double-quotes the property name; the TS interface key 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 `x': 0, [require(\"fs\").writeFileSync(\"\u003cmarker\u003e\",\"\")]: 0, 'y` -\u003e mock object literal; calling the mock factory writes the marker. Verified on 8.19.0.\n\n### Impact\n\nJavaScript / OS command execution (via child_process) on the machine of anyone who generates orval mocks from an attacker controlled spec and runs them (tests / MSW).\n\n### Suggested fix\n\nEscape the property name for the JS string key (JSON.stringify), and never interpolate a raw property name adjacent to [ ] in object-literal position.","status":"published","published":"2026-09-03T18:26:12Z","modified":"2026-09-03T18:26: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"}],"cwes":["CWE-89","CWE-95"],"updated_at":"2026-11-02T14:41:11.621873Z"}],"nvd":[{"id":"CVE-2026-71867","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a single quote in a schema property name is emitted into single-quoted object keys in generated MSW mock factories without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated mock factory is called by tests or an MSW handler, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/core/src/getters/keys.ts function getKey and MSW mock generation. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T18:17:24.277Z","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-71867","title":"Orval: RCE via schema property name -\u003e computed-property-key injection in the MSW mock generator","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a single quote in a schema property name is emitted into single-quoted object keys in generated MSW mock factories without safe encoding. This permits attacker-controlled JavaScript to be evaluated when the generated mock factory is called by tests or an MSW handler, resulting in code execution in the developer, CI, test, or application environment. The affected code is packages/core/src/getters/keys.ts function getKey and MSW mock generation. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:38:36.371Z","modified":"2026-10-28T02:30:31.697301069Z","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-2w86-xfrc-g85r","title":"Orval: RCE via schema property name -\u003e computed-property-key injection in the MSW mock generator","description":"### Summary\n\norval, when generating MSW mocks (output.mock: true), emits each schema property name as a single-quoted object key in the mock factory WITHOUT escaping the single quote. A ' in a property name closes the key and lands in object-literal context, where an injected computed property key [expr] is evaluated when the mock factory is called (e.g. in tests / MSW handlers) -\u003e RCE. The property name is a pure data field. Verified on orval 8.19.0 / Node. \n\n### Details\n\n```ts\nexport const getOpResponseMock = (...): Thing =\u003e ({'x': 0, [require(\"fs\").writeFileSync(\"PWNED\",\"\")]: 0, 'y': faker...., ...overrideResponse});\n```\n\nSafe elsewhere: the zod schema double-quotes the property name; the TS interface key 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 `x': 0, [require(\"fs\").writeFileSync(\"\u003cmarker\u003e\",\"\")]: 0, 'y` -\u003e mock object literal; calling the mock factory writes the marker. Verified on 8.19.0.\n\n### Impact\n\nJavaScript / OS command execution (via child_process) on the machine of anyone who generates orval mocks from an attacker controlled spec and runs them (tests / MSW).\n\n### Suggested fix\n\nEscape the property name for the JS string key (JSON.stringify), and never interpolate a raw property name adjacent to [ ] in object-literal position.","status":"published","published":"2026-09-03T18:26:12Z","modified":"2026-09-03T18:30:03.624241516Z","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:34.700741Z"},{"id":"ROOT-APP-NPM-CVE-2026-71867","title":"CVE-2026-71867 in orval - Patched by Root","description":"Root has patched CVE-2026-71867 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.994678948Z","updated_at":"2026-11-02T15:53:27.649662Z"}]}}
