Skip to main content

orval CVE-2026-96759

| EUVDEUVD-2026-85409 CRITICAL
Code Injection (CWE-94)
2026-09-23 VulnCheck GHSA-vg3c-9fm6-r5pj
9.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Host crafted OpenAPI spec
  2. Delivery
    Victim runs orval codegen on spec
  3. Exploit
    operationId breaks out of object literal
  4. Execution
    Injected JS emitted into generated hooks
  5. Impact
    Hook invocation executes attacker code

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 that a developer or automated pipeline runs orval (before 8.29.0) code generation against an OpenAPI specification whose operationId field is attacker-controlled, and then the generated TanStack Query/mutation hooks must actually be called for the injected JavaScript to execute. The specific sinks are the query-generator and mutation-generator emitting the raw operationId into a single-quoted object literal in the generated mutator options metadata; operationName is sanitized upstream but operationId is not. The key LIMITING factor is the trust boundary: the OpenAPI document must come from an untrusted source (e.g. a third-party or attacker-hosted spec consumed by a build), which is not the typical case of generating from a first-party spec - so despite PR:N in the vector, practical exploitation depends on the victim ingesting an untrusted spec and running codegen plus executing the output.

Impact

The headline CVSS 4.0 score is 9.3 (VC:H/VI:H/VA:H, AV:N/PR:N/UI:N), which frames this as critical unauthenticated remote code execution, but that framing is misleading for how the flaw actually triggers. This is a build-time / developer-tooling code-injection: orval only emits the malicious code if a developer runs generation against an attacker-supplied OpenAPI document, and the injected JavaScript executes only when the generated TanStack Query hooks are later called. That is effectively a user-interaction and trust-boundary dependency the CVSS 4.0 vector does not reflect (it sets UI:N), so the real-world attack surface is narrower than a 9.3 suggests. No EPSS score, no CISA KEV listing, and no SSVC decision data were provided, and no standalone public exploit is referenced - the closest artifact is the vendor's own regression test in PR #4008, which demonstrates the injection mechanism (an operationId payload that closes the string literal and runs an IIFE) but is a fix-verification test, not weaponized exploit code. CWE-94 and the source evidence (query-generator.ts / mutation-generator.ts emitting operationId into an unescaped single-quoted object literal) are well-corroborated and consistent with the description. Net: genuinely dangerous where untrusted OpenAPI specs are consumed by an automated pipeline, but for the common case of developers generating from their own trusted specs the practical priority is moderate, not the emergency a raw 9.3 implies.

Exploit ScenarioDerived

An attacker publishes or serves a crafted OpenAPI specification whose operationId contains a string-literal breakout such as "getPets',x:(()=>{throw new Error('pwned')})(),y:'". A developer runs orval (<8.29.0) against that spec to generate TanStack Query hooks; the unescaped operationId closes the emitted object literal and injects arbitrary JavaScript, which executes as soon as the generated query/mutation hook is invoked. The vendor patch includes a VM-based test proving the breakout, but no independent public exploit is cited.

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

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

Alert me

AnalysisAIv1 – Sep 23, 2026

Code generation in orval before 8.29.0 writes the raw OpenAPI operationId into a single-quoted object literal inside generated TanStack Query mutator metadata, so a crafted operationId can break out of the string and inject arbitrary JavaScript that executes when the generated query or mutation hooks are called. Practical exploitation requires a developer or CI pipeline to run orval codegen against an OpenAPI document whose operationId is attacker-controlled and then to execute the generated hooks - a conditional path that hinges on the trust boundary of the ingested spec, even though PR:N appears in the vector; the independent assessment (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) reflects this required victim interaction, while the headline CVSS 4.0 score of 9.3 (UI:N) overstates how freely the flaw triggers. No public exploit code and no CISA KEV entry were identified at time of analysis, and no EPSS score was provided; a vendor patch is available (orval 8.29.0).

RemediationAI

Vendor-released patch: upgrade orval to 8.29.0 or later, which applies jsStringLiteralEscape to both operationId and operationName via the new getOperationMetaLiteral() helper in packages/query/src/utils.ts (fix landed in PR https://github.com/orval-labs/orval/pull/4008 and commit b28c53f3e0c06190e0f6ea136737e6316432448f); see the advisory at https://github.com/orval-labs/orval/security/advisories/GHSA-vv88-cm6j-665j and the VulnCheck advisory at https://www.vulncheck.com/advisories/orval-before-8.29.0-code-injection-via-operationid. After upgrading, regenerate all clients and inspect the diff for any operationId metadata that previously contained quotes or backslashes, since pre-existing generated code stays vulnerable until rebuilt. If upgrading is not immediately possible, treat OpenAPI specifications as untrusted code: add a CI spec-linting gate that rejects or rewrites operationId values containing single quotes, backslashes or other string-terminator characters before codegen (trade-off: legitimate specs with unusual operationId conventions may need manual normalization), run orval in a sandboxed build job with no injected secrets and no network reachability so any payload that does reach generated output cannot easily exfiltrate or fetch stages (trade-off: slower, more constrained pipelines and possible friction for specs fetched over the network at build time), pin and audit the orval version used by every template and monorepo package so a shared generator cannot silently downgrade, and review generated hook files before they are committed or executed. Note that escaping or rejecting the character set in the spec is a compensating control, not a substitute for the 8.29.0 fix, and none of these mitigations preserve the vulnerable behavior.

Affected VersionsENISA

orval 0 <8.29.0

Affected Packages

euvd orval fix: 8.29.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

orval is a Node.js/TypeScript code generator that consumes an OpenAPI specification and emits typed API clients plus TanStack Query (React Query) hooks, queryOptions and mutationOptions wrappers. This is a classic CWE-94 code injection through a code generator: instead of executing untrusted input directly, the tool interpolates untrusted spec values into the source files it produces, so the generated code becomes the payload carrier. The vulnerable sinks are in packages/query/src/query-generator.ts and packages/query/src/mutation-generator.ts, which build metadata objects such as , { url: \${route}\, operationId: '${operationId}', operationName: '${operationName}' } using simple single-quoted string interpolation; operationName is passed through an upstream sanitize step, but operationId is taken raw from the OpenAPI document. A quote (or trailing backslash) in operationId closes the literal early, allowing additional object keys and arbitrary JavaScript expressions - for example an immediately-invoked function - to be appended and evaluated whenever the generated hook runs. The fix (PR #4008, commit b28c53f3e0c06190e0f6ea136737e6316432448f) introduces getOperationMetaLiteral() in packages/query/src/utils.ts, which applies jsStringLiteralEscape to both operationId and operationName; upstream tests use node:vm to evaluate the emitted fragment and confirm that quote and backslash payloads stay contained inside the string. The affected component is identified by CPE 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 (VulnCheck) 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

Spec is network-deliverable (AV:N) with no auth (PR:N), but a developer must run codegen on the untrusted spec and execute the generated hooks, so UI:R; injected JS yields full C/I/A in the dev/build context.

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:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

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

DescriptionCVE.org

orval before 8.29.0 fails to escape the operationId parameter when emitting it into generated TanStack Query mutator options metadata objects. Attackers can inject arbitrary JavaScript code through a crafted operationId in an OpenAPI specification that executes when generated hooks are called.

Technical POC Analysis

CWE-94 code injection in orval's query/mutation generator.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

Orval, an open-source code generator for TanStack Query clients, has a critical code-injection issue in versions before 8.29.0 that can put developer workstations and CI/CD pipelines at risk when they process untrusted OpenAPI specifications. The practical attack path requires a developer or automated pipeline to run codegen on an attacker-influenced spec and then execute the generated hooks, so the primary exposure is software supply-chain and third-party API trust rather than broad public exploitation; no public exploit identified at time of analysis. Leadership should prioritize upgrading affected build environments to 8.29.0 because a compromise could enable unauthorized code execution within development and build environments and undermine trust in generated software artifacts.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 66% exploitable
Prevalence
Medium
popular OpenAPI-to-TanStack-Query codegen library, sizable but dev-time footprint
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

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 No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
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-71871 CRITICAL POC
9.3 Aug 19

Code injection in Orval, a TypeScript client generator for OpenAPI v3 and Swagger v2 specs, allows arbitrary JavaScript

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

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