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 query 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, a tool that produces type‑safe JavaScript clients from OpenAPI specifications, can emit a module‑level template literal that contains an unescaped `${...}` expression or backtick from a query‑parameter default. When an attacker supplies a malicious value for that default, the resulting zod schema module is imported and the JavaScript is evaluated, allowing arbitrary code to run in the environment that imports the generated client. This is a direct code‑execution flaw and is identified as CWE‑1336.

Affected Systems

The vulnerability affects the Orval package by orval‑labs, specifically in versions prior to 8.21.0. The issue resides in packages/zod/src/index.ts in the formatDefaultValue function. Users who generate clients from OpenAPI v2 or v3 specifications that include a query‑parameter default containing backticks or `${…}` therefore produce unsafe code.

Risk and Exploitability

With a CVSS score of 9.3, the flaw is considered high severity. The EPSS score is not available, so current data does not indicate an active exploitation trend, and the vulnerability is not listed in CISA’s KEV catalog. Nevertheless, the attack vector is straightforward: an adversary who controls an OpenAPI spec can embed malicious defaults. When the generated zod schema module is later imported—such as during development, CI pipelines, or in a deployed application—the unescaped expression is evaluated and remote code is executed. The flaw requires code generation into a project but does not require any special privileges within that project once the module is imported.

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 to contain the fix.
  • If an upgrade cannot be performed immediately, remove or escape any `${…}` or backtick characters from query‑parameter defaults in the OpenAPI specification before feeding it to Orval.
  • When using older releases, disable the zod schema generation or otherwise sanitize the generated schema so that no unsafe template literals are emitted.

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-p4cg-3328-rvfg Orval: Import-time RCE via query-parameter default -> zod module-level template literal
History

Thu, 20 Aug 2026 15: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 19:15: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 query 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 query-parameter default -> zod module-level template literal
Weaknesses CWE-1336
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-19T17:48:14.929Z

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

Link: CVE-2026-72716

cve-icon Vulnrichment

Updated: 2026-08-19T17:47:51.148Z

cve-icon NVD

Status : Received

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

Modified: 2026-08-19T18:17:25.057

Link: CVE-2026-72716

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

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

Weaknesses
  • CWE-1336

    Improper Neutralization of Special Elements Used in a Template Engine