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.
Security readout for executives and security teams
Plain-English summary
A malicious or compromised API specification can cause Orval to generate JavaScript that runs when a generated Zod schema is imported. This could compromise developer machines, CI pipelines, tests, or deployed applications, potentially exposing secrets or altering builds. The issue affects Orval versions before 8.21.0.
Executive priority
Prioritize immediate remediation where external specifications enter automated build pipelines or generated schemas run with sensitive credentials. Upgrade and regenerate artifacts promptly. Environments using only trusted specifications remain affected but have a narrower trigger path; they should still remediate because specification repositories and dependencies can be compromised.
Technical view
Orval’s Zod generator passed query-parameter defaults through formatDefaultValue without safely encoding template-literal syntax. An attacker-controlled ${...} expression or backtick could therefore enter a module-level template literal and execute during module import. The flaw is classified as CWE-1336 and fixed in Orval 8.21.0.
Likely exposure
Exposure requires Orval below 8.21.0, Zod schema generation, attacker-influenced query-parameter defaults, and later import of the generated module. Highest-risk environments automatically generate clients from external, partner-controlled, or compromised OpenAPI or Swagger specifications with access to CI credentials, developer secrets, or production resources.
Exploitation context
The supplied record reports a network-reachable, low-complexity path with no privileges or user interaction and a CVSS 4.0 score of 9.3. However, it is not listed in KEV, and the supplied sources do not establish active exploitation in the wild. Treat malicious specifications as the principal documented delivery vector.
Researcher notes
The affected implementation is packages/zod/src/index.ts, specifically formatDefaultValue. Execution occurs at import time rather than only while generating code, widening potential impact to downstream consumers of committed generated artifacts. The supplied advisory, pull request, commit, and release identify 8.21.0 as the fix. No evidence supplied establishes public exploitation or affected products beyond Orval.
Mitigation direction
Upgrade Orval to version 8.21.0 or later.
Regenerate affected Zod schemas using the patched Orval version.
Restrict specification ingestion to trusted, authenticated sources.
Limit generator and import processes to least-privileged, isolated environments.
Review vendor guidance and the published fix before adopting custom backports.
Validation and detection
Inventory Orval versions in manifests, lockfiles, CI images, and developer tooling.
Identify workflows that generate Zod schemas from OpenAPI or Swagger specifications.
Determine whether specification sources can be modified by untrusted parties.
Inspect query-parameter defaults and generated schemas for unsafe template-literal syntax.
Confirm regenerated artifacts were produced with Orval 8.21.0 or later.
Review CI, developer, and application logs for unexpected activity following schema imports.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-1336: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
1ADP providers
5Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: yesTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-1336 · source CWE mapping
Improper Neutralization of Special Elements Used in a Template Engine
Improper Neutralization of Special Elements Used in a Template Engine represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.