CVE-2026-71865
moderateImport-time RCE in Orval zod client generator via unescaped query parameter names
Orval, a TypeScript client generator for OpenAPI specs, emits each query parameter name as a double-quoted key in the generated zod.object({...}) request-validation schema without escaping double quotes, so a crafted parameter name can break out of the string key and inject a computed property key ([expr]) containing arbitrary JavaScript. Because the generated module evaluates the expression when zod.object({...}) runs at module load, merely importing the generated client triggers execution — an import-time RCE. An attacker who controls the spec used to generate the client gains arbitrary JavaScript and potentially OS command execution in the Node.js process that imports it. Projects using Orval's zod client — and the hono client, which reuses that zod generation — built from attacker-influenced or untrusted specs are affected; sibling fields (schema property names, header parameter names) are tracked in separate reports. As of this analysis there is no known public exploit or public PoC, exploitation probability is low (EPSS 0.5%), and the flaw is not in CISA KEV.
What to do: Regenerate all zod and hono clients with an orval release that escapes query parameter names (JSON.stringify-style key escaping in zod.object key generation) once a patched version is published, and audit currently generated files for double quotes inside keys or unexpected [...] computed keys. Until patched, treat OpenAPI specs from untrusted sources as untrusted input — validate or sanitize parameter names before generation — and avoid importing generated clients produced from specs you do not control. Also check schema property names and header parameter names, which are the subject of separate reports.
| orval (npm project) orval — zod client generator | verified on 8.19.0; full affected version range not stated in available data |
| orval (npm project) orval — hono client generator (reuses zod generation) | verified on 8.19.0; full affected version range not stated in available data |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
Orval generates type-safe JavaScript clients in TypeScript from OpenAPI v3 and Swagger v2 specifications. Prior to 8.21.0, a double quote in a query parameter name is emitted into the generated request-validation 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 query request-validation generation. This issue is fixed in version 8.21.0.
- Ecosystems
- npm
- Weakness
- CWE-94, CWE-95, CWE-116
- 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
- GHSA
- GHSA-653q-5476-x79g (critical)
In the news0 stories
No ingested article mentions this CVE yet.