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 array item 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 JavaScript that runs automatically when a generated Zod schema is imported. This could compromise developer workstations, CI systems, test environments, or applications. The risk is highest where specifications come from external or insufficiently trusted sources.
Executive priority
Prioritize immediate remediation where untrusted specifications enter automated generation pipelines or generated schemas execute with valuable credentials. Upgrade and regenerate affected artifacts promptly. Environments using only controlled specifications remain affected but have a narrower practical attack path and should still be remediated urgently.
Technical view
The Zod generator’s formatDefaultValue handling did not safely encode expressions or backticks in array-item defaults. Attacker-controlled content could escape into a module-level template literal, producing generated JavaScript that executes during module import. The issue is classified under improper encoding, template injection, and code injection weaknesses.
Likely exposure
Potentially exposed environments use Orval below 8.21.0, generate Zod schemas from OpenAPI or Swagger specifications, and later import the generated modules. Exposure materially increases when specifications, dependencies, or schema updates are controlled by external or compromised parties.
Exploitation context
The supplied sources describe import-time remote code execution and assign CVSS 4.0 score 9.3. However, the CVE is not listed as KEV, and the source bundle provides no evidence of active exploitation or public weaponization. Successful abuse requires malicious specification content to reach Zod generation and the resulting module to be imported.
Researcher notes
The vulnerable path is packages/zod/src/index.ts in formatDefaultValue. The security boundary failure occurs during code generation, while execution occurs later at module import. Assessment should therefore trace specification provenance, generator version, generated-artifact reuse, import locations, and privileges available to each importing process.
Mitigation direction
Upgrade Orval to version 8.21.0 or later.
Treat externally supplied OpenAPI and Swagger specifications as untrusted input.
Regenerate Zod schemas after upgrading before importing or deploying them.
Restrict CI and generation environments using least privilege and isolated credentials.
Review vendor guidance for any additional release-specific precautions.
Validation and detection
Inventory Orval versions across developer, CI, test, and production environments.
Identify workflows generating Zod schemas from OpenAPI or Swagger specifications.
Determine whether specifications originate from external or insufficiently trusted sources.
Review previously generated schemas for unexpected array-default template expressions or backticks.
Confirm regenerated schemas were produced with Orval 8.21.0 or later.
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: 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-116 · source CWE mapping
Improper Encoding or Escaping of Output
Improper Encoding or Escaping of Output represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
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.
Improper Control of Generation of Code represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.