Description
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 array item 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.
Published: 2026-08-19
Score: 9.3 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Orval, a generator of type‑safe JavaScript clients from OpenAPI or Swagger documents, contains a flaw that allows arbitrary code evaluation when a default value in an array item of the specification contains a ${…} expression or backtick. The bad value is emitted directly into a module‑level template literal used by the zod schema generator without any encoding. When the generated zod schema module is imported, the templated JavaScript runs, giving the attacker remote code execution in the developer, CI, test or application environment. This vulnerability is exercised by the CWE‑94 (Code Injection), CWE‑116 (Improper Encoding), and CWE‑1336 (Unsafe Deserialization) weaknesses and can compromise confidentiality, integrity, and availability of the affected system.

Affected Systems

The risk applies to any project that uses orval‑labs:orval to generate client code. Versions of the package older than 8.21.0 are vulnerable. Updating the generator to 8.21.0 or a later release removes the unescaped template literal emission.

Risk and Exploitability

The CVSS score of 9.3 indicates a high‑severity risk. Exploitation requires the attacker to supply a malicious OpenAPI specification that contains an array default with a ${…} expression or backtick, and then have the generated client module imported in a runtime that executes the template literal. There is no public exploitation evidence (EPSS not available and it is not listed in CISA KEV). However, if an organization imports generated code from untrusted sources, the potential for code execution exists and the risk warrants immediate attention.

Generated by OpenCVE AI on August 20, 2026 at 13:13 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade orval to version 8.21.0 or newer.
  • If upgrading is not possible, validate and sanitize array default values in OpenAPI specifications to remove ${…} expressions or backticks before code generation.
  • Limit the import of generated client modules to trusted, controlled environments and consider running them under a restricted execution context.

Generated by OpenCVE AI on August 20, 2026 at 13:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-2h9g-j24r-h63g Orval: Import-time RCE via array-items default -> zod module-level template literal
History

Tue, 25 Aug 2026 04:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 19 Aug 2026 18:45:00 +0000

Type Values Removed Values Added
First Time appeared Orval-labs
Orval-labs orval
Vendors & Products Orval-labs
Orval-labs orval

Wed, 19 Aug 2026 17:45:00 +0000

Type Values Removed Values Added
Description 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 array item 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.
Title Orval: Import-time RCE via array-items default -> zod module-level template literal
Weaknesses CWE-116
CWE-1336
CWE-94
References
Metrics cvssV4_0

{'score': 9.3, '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'}


Subscriptions

Orval-labs Orval
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-25T03:32:48.556Z

Reserved: 2026-08-07T18:26:53.524Z

Link: CVE-2026-71869

cve-icon Vulnrichment

Updated: 2026-08-25T03:32:41.763Z

cve-icon NVD

Status : Received

Published: 2026-08-19T18:17:24.547

Modified: 2026-08-25T04:18:20.363

Link: CVE-2026-71869

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-20T13:15:03Z

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-1336

    Improper Neutralization of Special Elements Used in a Template Engine

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')