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

Impact

The vulnerability allows attacker-controlled JavaScript to be evaluated during the import of a generated zod schema module. An enumeration default value may contain a template literal such as ${…} or backticks that are emitted directly into a module‑level template literal without safe encoding. When this module is imported by a developer, CI, test runner, or application, the code inside the expression executes in the environment of the importer, leading to remote code execution. The weakness is identified by CWE-94 (Code Injection) and also involves poorly handled sensitive input as described by CWE-1336.

Affected Systems

orval‑labs orval, any project using this library to generate client code from an OpenAPI or Swagger specification, prior to version 8.21.0. Projects that import the generated zod schema modules are at risk. All installations of orval before 8.21.0, regardless of the target framework or runtime, could be affected if they process malicious or tampered specification files.

Risk and Exploitability

The CVSS score of 9.3 marks this issue as critical, with a high likelihood of exploitation when an attacker supplies a malicious specification file. Although the EPSS score is not available, the absence of a CISA KEV listing does not reduce the urgency. The exploit does not require any privileged user account; it only needs the ability to provide an OpenAPI spec that includes a harmful enum default. Once imported, arbitrary code runs in the context of the importing process, creating a severe security risk.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade orval to version 8.21.0 or later and regenerate all client code.
  • Rebuild the affected projects to ensure the generated zod schema modules no longer contain raw template literals or ${…} expressions in default values.
  • Audit your build and deployment pipelines to confirm that only trusted specification files are processed, and consider adding validation rules to reject or sanitize enum defaults before code generation.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-3575-w9fc-c2j6 Orval: Import-time RCE via enum-typed default -> zod module-level template literal
History

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 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.
Title Orval: Import-time RCE via enum-typed default -> zod module-level template literal
Weaknesses 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-21T19:43:39.471Z

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

Link: CVE-2026-71868

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

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

Modified: 2026-08-21T20:16:40.453

Link: CVE-2026-71868

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

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

Weaknesses
  • CWE-1336

    Improper Neutralization of Special Elements Used in a Template Engine

  • CWE-94

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