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 schema 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 tool that generates type‑safe JavaScript clients from OpenAPI specifications, contains an import‑time vulnerability that allows attacker‑controlled JavaScript to be evaluated when a generated zod schema module is imported. The flaw stems from unescaped template literals or ${...} expressions in schema default values that are emitted into a module‑level template literal in the zod schema generator. The affected code path is the formatDefaultValue function in packages/zod/src/index.ts, and execution of malicious JavaScript in the developer, CI, test, or application environment results in code execution with the privileges of the executing process.

Affected Systems

Any project that uses orval‑labs/orval to generate clients from OpenAPI or Swagger specifications is affected, particularly those employing versions prior to 8.21.0. The vulnerability applies to all environments where the generated code is imported, including local development, continuous integration pipelines, or deployed applications.

Risk and Exploitability

The CVSS score of 9.3 categorises this issue as critical, and the EPSS score is not available for this vulnerability. It is not listed in the CISA KEV catalog, but the lack of a false‑positive mitigation means the risk remains high until patched. Attackers can target the supply chain by modifying an OpenAPI spec supplied to orval; during import the resulting zod schema module will execute arbitrary JavaScript in the context of the importing process.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade orval to version 8.21.0 or newer, which removes the unsafe template literal handling.
  • If an immediate upgrade is impossible, avoid using OpenAPI specifications that include default values containing ${...} or backticks; sanitize or remove these defaults before processing.
  • Verify any third‑party specifications from untrusted sources are validated or sandboxed, and do not import generated code into environments where untrusted code could be executed.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-w727-8j6c-2rj4 Orval: Import-time RCE via schema default -> zod module-level template literal
History

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

Type Values Removed Values Added
Metrics ssvc

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


Thu, 20 Aug 2026 01: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 18:00: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 schema 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 schema 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-21T19:44:34.681Z

Reserved: 2026-08-10T13:48:09.545Z

Link: CVE-2026-72717

cve-icon Vulnrichment

Updated: 2026-08-21T19:44:30.862Z

cve-icon NVD

Status : Received

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

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

Link: CVE-2026-72717

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