Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft OpenAPI spec with ${...}/backtick enum default
-
DeliveryDeliver malicious spec to victim's codegen source
-
ExploitVictim runs Orval zod generation
-
ExecutionUnescaped payload emitted into template literal
-
PersistGenerated module imported in dev/CI
-
ImpactArbitrary JavaScript executes in environment
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires (1) the victim to use Orval's zod schema generation target, (2) an OpenAPI v3 or Swagger v2 specification under attacker influence that contains an enum default value with a backtick or ${...} expression, and (3) the generated zod schema module to be imported/loaded, which is when the injected code runs. Limiting factors that reduce real-world risk: the attacker must control or tamper with the input spec (fully trusted first-party specs are not exploitable), the vulnerable code path is specific to the zod generator rather than all Orval targets, and code execution only fires once the generated module is actually imported or built. Despite the vendor's UI:N rating, in practice a developer or CI job must actively run codegen against the malicious spec. |
| Impact | The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H) yields 9.3 and implies trivially remote, unauthenticated, high-impact exploitation, but the practical trigger is more constrained than that reads: an attacker must control the OpenAPI/Swagger specification fed to Orval, the victim must run zod generation against it, and the generated module must be imported. That said, those conditions are common in real pipelines - teams routinely codegen from third-party, vendor-hosted, or remotely fetched specs inside CI, making code execution a realistic supply-chain risk that even a mid-sized operator should treat as urgent given the developer/CI blast radius. No EPSS score, no CISA KEV entry, and no independently published exploit were provided, so there is no evidence of active exploitation; however, the fix commit includes tests with functional payloads (e.g., require('child_process').execSync('id')), which materially lowers the barrier to weaponization. Net: a genuine high priority for any team that generates zod schemas from untrusted specs, and low-to-moderate for teams that only ever process fully trusted, first-party specifications. |
| Exploit ScenarioDerived | An attacker publishes or tampers with an OpenAPI spec so that an enum's default value contains a backtick/${...} payload such as ${require('child_process').execSync('id')}. A developer or CI pipeline runs Orval's zod generation against that spec and imports the resulting schema module, at which point the template literal is evaluated and the attacker's JavaScript executes in that environment. The fix commit's own test payloads demonstrate this pattern, so a working proof of concept is effectively public even though no standalone exploit was released. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 19, 2026
Code execution in Orval before 8.21.0 occurs when its zod schema generator processes an attacker-controlled OpenAPI v3 or Swagger v2 specification: a ${...} expression or backtick placed in an enum default value is written unescaped into a module-level JavaScript template literal, so simply importing the generated schema module evaluates the attacker's code in the developer, CI, test, or application runtime. This is a CWE-94 code-injection flaw (CVSS 9.3) affecting the packages/zod/src/index.ts formatDefaultValue routine. No CISA KEV listing and no separately published exploit exist at time of analysis, though the vendor's fix commit ships tests containing working injection payloads.
RemediationAI
Vendor-released patch: upgrade Orval to 8.21.0 or later, which escapes spec-sourced values via jsesc before emitting them into generated code (fix in PR https://github.com/orval-labs/orval/pull/3692 and commit https://github.com/orval-labs/orval/commit/8ef1bfdf3f9bcaf9dabfbe2e42887f1c0e159ab6; advisory https://github.com/orval-labs/orval/security/advisories/GHSA-3575-w9fc-c2j6). Until upgraded, treat every OpenAPI/Swagger spec as untrusted input: source specs only from first-party, access-controlled locations and pin/verify their integrity, which prevents attacker injection but does not help if an upstream vendor spec is itself compromised. As additional compensating controls, run Orval codegen in a sandboxed or ephemeral CI job with no secrets and restricted network/filesystem access to limit blast radius, and code-review generated zod modules (grep for unexpected backticks or ${...} in default values) before importing or building them - the trade-off being added pipeline friction and reviewer burden.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Orval is a TypeScript client generator that turns OpenAPI/Swagger definitions into type-safe clients and validation schemas, including a zod target. In JavaScript, template literals delimited by backticks interpolate any ${...} expression they contain and execute it at evaluation time. The vulnerable formatDefaultValue function emitted enum default values directly into such a module-level template literal without escaping backticks, backslashes, or ${...} sequences, so spec-supplied text was treated as live code rather than inert string data. This is a classic CWE-94 (Improper Control of Generation of Code) sink: untrusted input crosses into a code-generation context. The upstream fix (PR #3692) introduces the jsesc library and a jsStringLiteralEscape helper to safely encode spec-sourced strings across related sinks (enum defaults, object keys, route/server URLs).
Know when Orval gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Attacker needs no privileges, but the victim must run codegen against a malicious spec and import the output, so UI:R; full unsandboxed RCE gives C/I/A:H with no scope change.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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 an enum 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.
Executive ViewAI
Orval code-generation library before version 8.21.0 contains a critical code-injection vulnerability that executes attacker-controlled code when processing a malicious OpenAPI specification. Any developer, CI/CD pipeline, or application runtime that imports a generated schema from an untrusted specification faces immediate code execution risk, potentially compromising the entire build and deployment chain. Organizations using Orval must upgrade immediately to prevent attackers from injecting code through supply-chain manipulation of API specifications.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
orval (TypeScript API client generator) before 7.18.0 has code injection via OpenAPI specification summary fields in MCP
Arbitrary code execution in Orval (orval-labs/orval) before 8.21.0 allows an attacker who controls an OpenAPI v3 or Swag
Code injection in Orval before 8.21.0 lets an attacker-controlled OpenAPI v3 or Swagger v2 specification execute arbitra
Code injection in Orval before 8.21.0 lets an attacker who controls an OpenAPI v3 or Swagger v2 specification embed exec
Arbitrary code execution in Orval before 8.21.0 arises when the code generator emits an unescaped backtick (or ${...}) f
Code injection in Orval, a TypeScript/JavaScript API client generator, allows a malicious OpenAPI v3 or Swagger v2 speci
Code injection in Orval before 8.21.0 lets an attacker-controlled OpenAPI v3 / Swagger v2 specification achieve arbitrar
Arbitrary code execution in Orval (OpenAPI/Swagger TypeScript client generator) before 8.21.0 lets an attacker who contr
Code injection in Orval (orval-labs/orval) before 8.21.0 allows an attacker who controls an OpenAPI v3 or Swagger v2 spe
Code injection in Orval, a TypeScript client generator for OpenAPI v3 and Swagger v2 specs, allows arbitrary JavaScript
I analyzed the provided intelligence and produced the synthesis below. One thing to flag first: **⚠️ Prompt-injection n
External $ref resolution in Orval prior to version 8.22.0 allows server-side request forgery and path traversal against
EUVD-2026-62605
GHSA-3575-w9fc-c2j6
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB