Skip to main content

Orval CVE-2026-71871

| EUVDEUVD-2026-62601 CRITICAL
Code Injection (CWE-94)
2026-08-19 GitHub_M GHSA-8j6p-r8jg-mxqh
9.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft OpenAPI spec with ${...}/backtick in header default
  2. Delivery
    Deliver malicious spec to victim (public API, PR, dependency)
  3. Exploit
    Victim runs Orval zod codegen (<8.21.0)
  4. Execution
    Payload emitted unescaped into template literal
  5. Persist
    Generated module imported in build/CI
  6. Impact
    Arbitrary code executes with build-host privileges

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

The attacker must control the default value of a header parameter (or, per the broader fix, a server URL, server variable default, or path segment) within an OpenAPI v3 or Swagger v2 specification that the victim feeds to Orval. Exploitation then requires the victim to (1) run Orval codegen using the zod client target against that spec on a version below 8.21.0, and (2) import/execute the generated zod schema module, which is when the injected JavaScript runs. Limiting factors: it does not affect Orval users who only process trusted first-party specs, it requires the developer/CI to actually generate and import the output (so despite the vendor's UI:N rating there is real user action involved), and the impact is confined to the code-generation host (developer workstation, CI runner, test, or app build environment) rather than a remote production service.

Impact

The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H) scores 9.3 and implies remote, unauthenticated, no-interaction exploitation with full confidentiality/integrity/availability loss - but the UI:N rating is questionable because exploitation genuinely requires a victim to run Orval codegen against the attacker-influenced spec and then import the generated module, which is meaningful user interaction. This is best understood as a build-time/supply-chain code-execution issue triggered by processing untrusted input, not a runtime service being attacked over the wire, so raw comparison to a network RCE overstates spray-and-pray risk. No EPSS score, no CISA KEV listing, and no confirmed in-the-wild exploitation are present in the provided data; the signal is high technical impact plus a straightforward, test-demonstrated trigger, tempered by the requirement that a target deliberately generate a client from a malicious specification. Realistic priority is high for teams that run Orval against third-party or user-supplied OpenAPI documents in CI, and lower for teams that only process trusted first-party specs.

Exploit ScenarioDerived

An attacker publishes or supplies an OpenAPI spec whose header parameter default value contains a payload such as +require('child_process').execSync('id')+; a developer or CI pipeline runs Orval to generate the zod client, and code executes as soon as the generated schema module is imported during build or test. Because the trigger is import-time, a single CI job that processes the malicious spec is enough to compromise the build environment and any secrets it holds. The fixing PR includes tests exercising exactly these execSync/writeFileSync payloads, so a working payload is effectively documented.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 19, 2026

Code injection in Orval, a TypeScript client generator for OpenAPI v3 and Swagger v2 specs, allows arbitrary JavaScript execution when a malicious API specification is processed. In versions prior to 8.21.0, a ${...} interpolation or backtick placed in a header parameter's default value is emitted unescaped into a module-level template literal by the zod schema generator (formatDefaultValue in packages/zod/src/index.ts), so the payload runs the moment the generated schema module is imported in a developer, CI, test, or application environment. No public exploit has been identified at time of analysis, though the fixing PR (#3692) ships proof-of-concept-grade tests demonstrating require('child_process').execSync payloads; the flaw carries a high CVSS 4.0 score of 9.3.

RemediationAI

Vendor-released patch: upgrade Orval to 8.21.0 or later (release https://github.com/orval-labs/orval/releases/tag/v8.21.0), which adds jsesc-based escaping of backticks, ${, and backslashes in generated output. Until upgrading, do not run Orval codegen against OpenAPI/Swagger specifications from untrusted or externally controlled sources, and treat spec files as untrusted input in CI - pin and review any third-party spec before generation. As a compensating control, run code generation in an isolated, network-restricted, least-privilege sandbox (e.g. an ephemeral container without credentials or outbound network) so that any injected code cannot reach secrets or production systems; the trade-off is added build complexity. You can also manually audit generated zod schema modules for unexpected ${...}/backtick sequences before importing them, though this scales poorly. Reference the advisory GHSA-8j6p-r8jg-mxqh for details.

Affected VersionsENISA

orval < 8.21.0

Affected Packages

npm orval fix: 8.21.0

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 consumes OpenAPI/Swagger documents and emits TypeScript client code, including zod runtime validation schemas. Values taken from the input specification - here the default value of a header parameter - are string-concatenated into generated source that uses JavaScript template literals (backtick-delimited strings). Because template literals evaluate ${...} interpolation and backticks delimit the literal, any such sequence in the untrusted default breaks out of the intended string context and becomes executable code, the classic CWE-94 (Improper Control of Generation of Code / code injection) root cause. The fix introduces the jsesc library and a jsStringLiteralEscape/getKey helper to safely encode backticks, ${, and backslashes across multiple emitters (zod defaults, route/server URLs, and object keys), indicating the unsafe-emission pattern spanned several code paths, not just the zod default handler. Affected package per CPE is cpe:2.3:a:orval-labs:orval.

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

Vendor (GitHub_M) PRIMARY 9.3 CRITICAL
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
vuln.today AI 8.8 HIGH

Malicious spec is deliverable over the network (AV:N) with no attacker privileges (PR:N), but the victim must run codegen and import the module (UI:R); import-time execution yields full C:H/I:H/A:H on the build host without crossing a security authority (S:U).

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 19, 2026 - 18:03 EUVD
CVE Published
Aug 19, 2026 - 17:33 cve.org
CRITICAL 9.3

DescriptionCVE.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 a header 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.

Executive ViewAI

Why It Matters

Orval, a code generation tool widely used in development and CI/CD pipelines, contains a critical vulnerability that allows arbitrary code execution when processing API specifications. This affects any developer, build system, or deployment process that uses Orval versions prior to 8.21.0, potentially enabling attackers to inject malicious code across your entire development lifecycle. Immediate patching is required to prevent unauthorized code execution in development, testing, and production environments.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.5%
Top 61% exploitable
Prevalence
Medium
popular OpenAPI-to-TypeScript client generator, common but not universal in JS build toolchains
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

66
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

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.

More in Orval

View all
CVE-2026-22785 CRITICAL POC
9.8 Jan 12

orval (TypeScript API client generator) before 7.18.0 has code injection via OpenAPI specification summary fields in MCP

CVE-2026-72717 CRITICAL POC
9.3 Aug 19

Arbitrary code execution in Orval (orval-labs/orval) before 8.21.0 allows an attacker who controls an OpenAPI v3 or Swag

CVE-2026-72716 CRITICAL POC
9.3 Aug 19

Code injection in Orval before 8.21.0 lets an attacker-controlled OpenAPI v3 or Swagger v2 specification execute arbitra

CVE-2026-62681 CRITICAL POC
9.3 Aug 19

Code injection in Orval before 8.21.0 lets an attacker who controls an OpenAPI v3 or Swagger v2 specification embed exec

CVE-2026-62682 CRITICAL POC
9.3 Aug 19

Arbitrary code execution in Orval before 8.21.0 arises when the code generator emits an unescaped backtick (or ${...}) f

CVE-2026-71867 CRITICAL POC
9.3 Aug 19

Code injection in Orval, a TypeScript/JavaScript API client generator, allows a malicious OpenAPI v3 or Swagger v2 speci

CVE-2026-71868 CRITICAL POC
9.3 Aug 19

Code execution in Orval before 8.21.0 occurs when its zod schema generator processes an attacker-controlled OpenAPI v3 o

CVE-2026-71865 CRITICAL POC
9.3 Aug 19

Code injection in Orval before 8.21.0 lets an attacker-controlled OpenAPI v3 / Swagger v2 specification achieve arbitrar

CVE-2026-71869 CRITICAL POC
9.3 Aug 19

Arbitrary code execution in Orval (OpenAPI/Swagger TypeScript client generator) before 8.21.0 lets an attacker who contr

CVE-2026-71864 CRITICAL POC
9.3 Aug 19

Code injection in Orval (orval-labs/orval) before 8.21.0 allows an attacker who controls an OpenAPI v3 or Swagger v2 spe

CVE-2026-71866 CRITICAL POC
9.3 Aug 19

I analyzed the provided intelligence and produced the synthesis below. One thing to flag first: **⚠️ Prompt-injection n

CVE-2026-62680 HIGH POC
7.1 Aug 19

External $ref resolution in Orval prior to version 8.22.0 allows server-side request forgery and path traversal against

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy