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.
Security readout for executives and security teams
Plain-English summary
Orval versions before 8.21.0 can turn a malicious API specification into executable JavaScript during client generation. The code runs when a generated Zod schema is imported, potentially compromising developer machines, CI systems, tests, or applications. Exposure depends on whether specifications or header defaults can be influenced by an attacker.
Executive priority
Prioritize immediate remediation where CI or production builds consume third-party, uploaded, or remotely retrieved API specifications. These environments may hold source code, deployment credentials, and release authority. Upgrade promptly and investigate if untrusted specifications were processed and generated modules imported.
Technical view
The Zod generator’s formatDefaultValue function failed to safely encode header-parameter defaults before placing them in a module-level template literal. Special template-literal content could become JavaScript and execute at module import time. The issue maps to improper encoding and code-generation weaknesses, including CWE-116, CWE-1336, and CWE-94.
Likely exposure
Highest risk exists where Orval before 8.21.0 processes externally supplied or insufficiently trusted OpenAPI or Swagger documents and generated Zod modules are subsequently imported. Internally controlled specifications reduce likelihood but do not eliminate supply-chain or repository compromise risk.
Exploitation context
The supplied CVSS 4.0 score is 9.3, reflecting network-reachable input, low complexity, no privileges, and no user interaction. The bundle reports that this CVE is not in KEV, and no supplied source establishes active exploitation. Treat practical exploitation status as unconfirmed.
Researcher notes
The affected implementation is packages/zod/src/index.ts, specifically formatDefaultValue. Execution occurs at import time rather than only while generating code, broadening the affected environments. The supplied advisory, patch commit, pull request, and release identify 8.21.0 as the fixed version. Public evidence supplied here does not establish exploitation in the wild.
Mitigation direction
Upgrade Orval to version 8.21.0 or later.
Regenerate affected Zod schemas using the upgraded version.
Restrict code generation to trusted OpenAPI and Swagger specifications.
Avoid importing previously generated schemas until their source and generation history are reviewed.
Investigate exposed credentials if suspicious generated code was imported.
Validation and detection
Inventory Orval versions across developer, CI, test, and build environments.
Identify workflows generating Zod schemas from OpenAPI or Swagger inputs.
Review specification provenance and header-parameter defaults for untrusted modifications.
Confirm generated schemas were rebuilt with Orval 8.21.0 or later.
Review relevant execution logs for unexpected activity during 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 · medium confidence lookup
CWE-116: User-session and phishing behavior lookup
Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. 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.
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.
Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. 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: noneAutomatable: 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.