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

Impact

Orval is a tool that generates type‑safe JavaScript client code from OpenAPI/Swagger specifications. Before version 8.21.0, a header parameter default that contained a backtick or a ${…} expression was emitted directly into a module‑level template literal in the generated Zod schema. The injected text is evaluated when the schema module is imported, giving an attacker the ability to run arbitrary JavaScript in the environment that imports the file. This constitutes a remote code execution vulnerability that can affect developers, continuous‑integration pipelines, testing environments and end‑user applications. The weakness involves code injection, unsafe string handling and improper input sanitisation, reflected by CWE‑94, CWE‑116 and CWE‑1336.

Affected Systems

The only affected product is orval, a package maintained by orval‑labs. Versions of the orval CLI prior to 8.21.0 are vulnerable. Current releases from 8.21.0 onward contain a patch that removes unsafe template literal emission.

Risk and Exploitability

The vulnerability has a CVSS base score of 9.3, rating it as critical. The EPSS score is not available, but the lack of listing in the CISA KEV catalog suggests no current widespread exploitation reports. Attacker feasibility is high: the exploit requires the ability to supply a malicious OpenAPI spec where the header default contains a backtick or ${…} expression; once a developer or build system generates the Zod schema and the resulting module is imported, code execution occurs. The impact is complete code‑execution privilege in the importing process, with potential takeover of the CI environment, development machine or the deployed application.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade orval to version 8.21.0 or later – the fix removes unsanitised template literal generation.
  • Re‑run the schema generation against all OpenAPI spec files after the upgrade to ensure no legacy modules remain that contain the vulnerable template.
  • As a temporary measure, review and sanitise OpenAPI specifications to remove any backticks or ${…} text from header defaults before generating schemas, or reject such default values via a linting rule.
  • Monitor dependency updates and scan source repositories for usage of orval older than 8.21.0.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-8j6p-r8jg-mxqh Orval: Import-time RCE via header-parameter default -> zod module-level template literal
History

Fri, 21 Aug 2026 22:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', '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 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.
Title Orval: Import-time RCE via header-parameter 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-21T21:49:37.465Z

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

Link: CVE-2026-71871

cve-icon Vulnrichment

Updated: 2026-08-21T21:10:49.251Z

cve-icon NVD

Status : Received

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

Modified: 2026-08-21T22:16:44.210

Link: CVE-2026-71871

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-20T13:30:17Z

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')