Remote Code Execution in Orval via Malicious Zod Schema Generation
Orval versions prior to 8.21.0 are vulnerable to remote code execution during module import due to improper sanitization of OpenAPI query parameter default values in generated Zod schemas.
CVE search metadata
CVE search record: CVE-2026-72716. EPSS: 0.52%. KEV: no. Product: Orval (< 8.21.0). Brief: Remote Code Execution in Orval via Malicious Zod Schema Generation. Brief link: https://feed.craftedsignal.io/briefs/2026-09-orval-rce/
What's new
- 1. added coverage for orval (< 8.21.0) Sep 2, 18:03 via ghsa
Orval, a popular tool for generating TypeScript clients and Zod schemas from OpenAPI specifications, contains a critical vulnerability (CVE-2026-72716) that allows for remote code execution. The issue stems from the way the tool emits query parameter default values within the generated Zod schema modules. Specifically, these values are written as module-level template literals (e.g., export const …Default = <default>;) without adequate escaping of backticks or the ${ character sequence.
An attacker who can provide or influence an OpenAPI specification can include a crafted default value containing a JavaScript expression, such as v${<attacker-controlled-JS>}w. When an application imports the generated Zod schema module, the JavaScript engine evaluates the interpolated expression, leading to arbitrary code execution within the context of the importing process. This vulnerability is present in Orval version 8.19.0 and affects all versions prior to 8.21.0. The exploit requires no additional API interaction once the malicious schema is generated and integrated into the victim's codebase.
Impact
Successful exploitation results in arbitrary code execution during the build or runtime import phase of any application relying on Orval-generated schemas. This poses a significant risk to CI/CD pipelines, build servers, and runtime environments that process untrusted OpenAPI descriptions. The scope includes any application that integrates Orval to generate schemas from attacker-influenced input sources, such as public repositories or user-submitted API documentation.
Recommendation
Prioritized, concrete actions for development and security teams:
- Upgrade Orval to version 8.21.0 or later immediately to resolve CVE-2026-72716.
- Audit existing OpenAPI specifications used in build processes to ensure
defaultvalues do not contain suspicious syntax like${or backticks. - If immediate patching is not possible, implement strict validation of OpenAPI specification files before feeding them into the Orval generator.
- Review build pipeline logs for unexpected execution of JavaScript modules generated by Orval.
Immediate actions
Upgrade Orval to version 8.21.0 or later
Mitigations
Validate OpenAPI specifications for malicious template literal syntax
CVE-2026-72716