ZeroHour

CVE-2026-71864

moderate

Import-time RCE in orval zod/hono clients via unescaped OpenAPI header parameter names

CVSS 4.0
9.3 critical
EPSS
<1%p47
Published
()
Modified
AI analysis

orval, an npm tool that generates API clients from OpenAPI specifications, fails to escape double quotes when it writes header parameter names as keys into the generated zod.object request-validation schema of its zod client (and the hono client, which reuses that generation). A header parameter name containing a double quote in a spec can break out of the generated string key and inject an attacker-chosen JavaScript expression as a computed property key, which is evaluated when the generated module is imported because the zod.object call runs at module load. An attacker who controls or tampers with header parameter names in a spec used for code generation therefore gains arbitrary JavaScript — and potentially OS command — execution in the Node.js process that imports the generated client, i.e., import-time RCE, scored 9.3 critical under CVSS 4.0. Affected are teams that generate zod or hono clients with orval from specs that are not fully trusted (third-party, partner-supplied, or user-influenced API definitions) and then import the generated code in an application or build pipeline. There is no known exploitation in the wild and no public PoC, it is not in CISA KEV, and EPSS estimates roughly a 0.5% probability of exploitation within 30 days.

What to do: Until a fixed orval release is available (the data does not specify a patched version, so track the orval advisory/changelog), avoid importing zod or hono clients generated from specs you do not fully control. As an interim check, audit OpenAPI specs for double quotes or injection syntax in header parameter names and inspect generated files for unescaped string keys adjacent to computed-key bracket syntax in zod.object schemas. Regenerate and redeploy all zod/hono clients with the patched release once published; related fixes may also cover schema property and query parameter names tracked in separate reports.

Affected
orval (npm) - zod client generatorverified on 8.19.0; affected version range not specified in the available data
orval (npm) - hono client generator (reuses zod generation)verified on 8.19.0; affected version range not specified in the available data
Estimated exposure
moderateplausibly on the order of 10,000-100,000 developer projects (only the subset generating zod/hono clients from untrusted specs is realistically exposed) — No install or download counts are included in the data; the estimate is based on orval's standing as a widely used OpenAPI code generator in the npm ecosystem, narrowed by the requirement to use the zod/hono client output and to import…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

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 header 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 header 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-6437-gxhq-pqv8 (critical)

In the news

No ingested article mentions this CVE yet.