{"id":"CVE-2026-72716","aliases":["EUVD-2026-62600","GHSA-p4cg-3328-rvfg","ROOT-APP-NPM-CVE-2026-72716"],"status":"published","title":"Orval: Import-time RCE via query-parameter default -\u003e zod module-level template literal","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a ${...} expression or backtick in a query parameter default is emitted into a module-level template literal emitted by zod schema generation 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 function formatDefaultValue. 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-11","score":0.00653,"percentile":0.51742,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-1336"],"published":"2026-08-19T17:33:01Z","modified":"2026-10-28T02:30:52Z","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.13.2-aikido.2","7.13.2-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.13.2-root.io.2","7.13.2-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.13.2-aikido.2"},{"fixed":"7.13.2-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.13.2-root.io.2"},{"fixed":"7.13.2-root.io.3"}]}]}],"products":[{"vendor":"orval-labs","product":"orval"}],"references":[{"url":"https://github.com/orval-labs/orval/security/advisories/GHSA-p4cg-3328-rvfg","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-72716","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-p4cg-3328-rvfg"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/72xxx/CVE-2026-72716.json","tags":["advisory"]},{"url":"https://github.com/orval-labs/orval","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-72716","title":"Orval: Import-time RCE via query-parameter default -\u003e zod module-level template literal","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a ${...} expression or backtick in a query parameter default is emitted into a module-level template literal emitted by zod schema generation 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 function formatDefaultValue. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:33:01.745Z","modified":"2026-08-19T17:48:14.929Z","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-1336"],"updated_at":"2026-11-02T14:19:51.663093Z"}],"euvd":[{"id":"EUVD-2026-62600","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a ${...} expression or backtick in a query parameter default is emitted into a module-level template literal emitted by zod schema generation 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 function formatDefaultValue. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:33:01Z","modified":"2026-08-19T17:48:14Z","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-p4cg-3328-rvfg","title":"Orval: Import-time RCE via query-parameter default -\u003e zod module-level template literal","description":"### Summary\n\nOrval's zod schema generation emits the **query-parameter** `default` value as a module-level template literal\n(`export const …Default = `\u003cdefault\u003e`;`) without escaping `${` or the backtick. A default of the form\n`v${\u003ccode\u003e}w` injects a live JavaScript expression evaluated when the generated zod schema module is\nimported, executing attacker-controlled code at import — no request or function call needed. Verified\non Orval 8.19.0; survives default OpenAPI validation.\n\n### Details\n\n```ts\nexport const …Default = `v${globalThis.ORVPWN()}w`;   // ${...} = arbitrary JS expression, runs at import\n```\n\nMalicious input: a query parameter with a `default` of `v${\u003cattacker JS\u003e}w`. `${...}` permits any JS expression.\n\nNote: this is one of several `default`-bearing positions that reach the same unescaped zod\ntemplate-literal sink; a single fix (escape `default` values) closes all of them, and a CNA may choose\nto consolidate the related reports.\n\n### PoC\n\n`reproduce.sh` (+ `make_spec.py`) attached: generates the zod schema with default validation, bundles\nit, imports it, and shows a marker written at import. Verified on 8.19.0.\n\n### Impact\n\nCode execution at import in any application that imports a zod schema module generated from an\nattacker-controlled or attacker-influenced OpenAPI description.\n\n### Suggested fix\n\nEmit `default` values via a proper string-literal encoder (JSON.stringify, or escape backtick and `${`\nif a template literal must be used); never interpolate a spec value into a template literal. Apply to\nevery `default` position.\n[maintainer-report.txt](https://github.com/user-attachments/files/29399067/maintainer-report.txt)\n[make_spec.py](https://github.com/user-attachments/files/29399068/make_spec.py)\n[reproduce.sh](https://github.com/user-attachments/files/29399069/reproduce.sh)","status":"published","published":"2026-09-02T14:53:14Z","modified":"2026-09-02T14:53:16Z","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-1336"],"updated_at":"2026-11-02T14:41:10.121131Z"}],"nvd":[{"id":"CVE-2026-72716","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a ${...} expression or backtick in a query parameter default is emitted into a module-level template literal emitted by zod schema generation 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 function formatDefaultValue. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T18:17:25.057Z","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-1336"],"updated_at":"2026-11-02T14:12:39.962615Z"}],"osv":[{"id":"CVE-2026-72716","title":"Orval: Import-time RCE via query-parameter default -\u003e zod module-level template literal","description":"Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a ${...} expression or backtick in a query parameter default is emitted into a module-level template literal emitted by zod schema generation 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 function formatDefaultValue. This issue is fixed in version 8.21.0.","status":"published","published":"2026-08-19T17:33:01.745Z","modified":"2026-10-28T02:30:52.996748735Z","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-1336"],"updated_at":"2026-11-02T15:45:15.88521Z"},{"id":"GHSA-p4cg-3328-rvfg","title":"Orval: Import-time RCE via query-parameter default -\u003e zod module-level template literal","description":"### Summary\n\nOrval's zod schema generation emits the **query-parameter** `default` value as a module-level template literal\n(`export const …Default = `\u003cdefault\u003e`;`) without escaping `${` or the backtick. A default of the form\n`v${\u003ccode\u003e}w` injects a live JavaScript expression evaluated when the generated zod schema module is\nimported, executing attacker-controlled code at import — no request or function call needed. Verified\non Orval 8.19.0; survives default OpenAPI validation.\n\n### Details\n\n```ts\nexport const …Default = `v${globalThis.ORVPWN()}w`;   // ${...} = arbitrary JS expression, runs at import\n```\n\nMalicious input: a query parameter with a `default` of `v${\u003cattacker JS\u003e}w`. `${...}` permits any JS expression.\n\nNote: this is one of several `default`-bearing positions that reach the same unescaped zod\ntemplate-literal sink; a single fix (escape `default` values) closes all of them, and a CNA may choose\nto consolidate the related reports.\n\n### PoC\n\n`reproduce.sh` (+ `make_spec.py`) attached: generates the zod schema with default validation, bundles\nit, imports it, and shows a marker written at import. Verified on 8.19.0.\n\n### Impact\n\nCode execution at import in any application that imports a zod schema module generated from an\nattacker-controlled or attacker-influenced OpenAPI description.\n\n### Suggested fix\n\nEmit `default` values via a proper string-literal encoder (JSON.stringify, or escape backtick and `${`\nif a template literal must be used); never interpolate a spec value into a template literal. Apply to\nevery `default` position.\n[maintainer-report.txt](https://github.com/user-attachments/files/29399067/maintainer-report.txt)\n[make_spec.py](https://github.com/user-attachments/files/29399068/make_spec.py)\n[reproduce.sh](https://github.com/user-attachments/files/29399069/reproduce.sh)","status":"published","published":"2026-09-02T14:53:14Z","modified":"2026-09-02T15:00:09.983937397Z","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-1336"],"updated_at":"2026-11-02T15:46:52.534897Z"},{"id":"ROOT-APP-NPM-CVE-2026-72716","title":"CVE-2026-72716 in orval - Patched by Root","description":"Root has patched CVE-2026-72716 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.399327626Z","updated_at":"2026-11-02T15:53:27.649662Z"}]}}
