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.
Security readout for executives and security teams
Plain-English summary
Orval versions before 8.21.0 can turn a malicious default value in an OpenAPI specification into JavaScript that runs when generated Zod code is imported. This could compromise developer workstations, CI systems, tests, or applications. The risk depends on whether an attacker can influence specifications processed by Orval.
Executive priority
Treat this as an urgent software-supply-chain remediation where untrusted specifications reach development or CI pipelines. Inventory Orval usage immediately, upgrade to 8.21.0 or later, regenerate affected output, and investigate potentially exposed environments. Prioritize systems holding deployment credentials, source-code access, signing keys, or production secrets.
Technical view
Before 8.21.0, Orval's Zod generator does not safely encode certain schema-default content in a module-level template literal. The vulnerable formatDefaultValue function can therefore produce generated JavaScript that evaluates attacker-controlled content during module import, causing code execution with that environment's privileges.
Likely exposure
Exposure exists where Orval below 8.21.0 generates Zod schemas from specifications that external users, suppliers, repositories, or compromised services can influence. Impact occurs when the resulting module is imported. Pipelines using only trusted specifications, not generating Zod schemas, or not importing generated output have reduced exposure.
Exploitation context
The supplied sources do not establish active exploitation, and the CVE is not listed as KEV in the bundle. Exploitation requires influence over a processed schema default followed by import of the generated Zod module. Successful exploitation could affect confidentiality, integrity, and availability in the importing environment.
Researcher notes
The vulnerable location is packages/zod/src/index.ts in formatDefaultValue. The weakness maps to improper output encoding, template-expression injection, and code injection. Review should distinguish specification ingestion from execution: compromise occurs when vulnerable generated Zod output is imported. The bundle identifies the fixing release and associated pull request and commit.
Mitigation direction
Upgrade Orval to version 8.21.0 or later.
Regenerate affected Zod schema modules using the upgraded Orval version.
Restrict untrusted OpenAPI specifications from code-generation pipelines until upgraded.
Review affected environments for unexpected activity associated with generated-module imports.
Validation and detection
Confirm all Orval installations and lockfiles resolve to version 8.21.0 or later.
Identify pipelines that generate Orval Zod schemas and import their output.
Assess whether external contributors or services can modify processed OpenAPI specifications.
Review schema defaults and generated modules for suspicious template-literal content without executing them.
Regenerate schemas after upgrading and verify defaults are safely encoded.
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.