CVE-2026-96757

orval before 8.29.0 Code Injection via unescaped OpenAPI media-type

Published Sep 23, 2026 CVSS 4.0 · 9.3 Critical EPSS < 1% KEV · Not listed
Description
orval before 8.29.0 fails to escape OpenAPI media-type keys when emitting them into single-quoted Content-Type string literals in generated code. Attackers can inject JavaScript through crafted media-type keys in OpenAPI specifications that executes when generated fetch operations or mock resolvers are invoked.

Analysis

AI-generated

Technical impact

The vulnerability resides in the way orval handles media-type keys within OpenAPI specifications. These keys are inserted into single-quoted Content-Type string literals in the generated code without proper escaping. If an attacker supplies a crafted media-type key, the resulting JavaScript code is executed when the generated fetch operation or mock resolver runs. This flaw is a classic code-injection problem (CWE-94) that can lead to remote code execution in the environment where the generated code is executed.

Affected Systems

All releases of orval produced by orval-labs prior to version 8.29.0 are affected. The product is the orval command-line tool that generates client code from OpenAPI specifications. Any system that uses orval to generate fetch libraries or mock servers from a spec containing unescaped media-type keys is at risk until the code is regenerated with a patched version.

Risk and Exploitability

The CVSS score of 9.3 reflects the high impact and requirement for the attacker to supply a malicious OpenAPI document. The EPSS score is unavailable but the lack of KEV listing does not diminish the intrinsic severity. Attackers can achieve arbitrary JavaScript execution by crafting media-type values in a specification that an organization feeds to orval, causing the generated code to execute the payload upon use. Consequently, the exposure risk remains high until the environment is patched or the input sanitized.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade orval to version 8.29.0 or newer to eliminate the injection path.
  • If immediate upgrade is not possible, sanitize or escape media-type keys in the OpenAPI specification before processing or remove problematic media-type entries.
  • Disable orval's automated code generation for fetch operations that include user-provided media-types until the patch is applied.

Generated by OpenCVE AI on September 23, 2026 at 17:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description orval before 8.29.0 fails to escape OpenAPI media-type keys when emitting them into single-quoted Content-Type string literals in generated code. Attackers can inject JavaScript through crafted media-type keys in OpenAPI specifications that executes when generated fetch operations or mock resolvers are invoked.
Title orval before 8.29.0 Code Injection via unescaped OpenAPI media-type
First Time appeared Orval
Orval orval
Weaknesses CWE-94
CPEs cpe:2.3:a:orval:orval:*:*:*:*:*:*:*:*
Vendors & Products Orval
Orval orval
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 9.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Sep 23, 2026, 5:48 PM
Reserved
Sep 23, 2026, 3:58 PM
Status
Deferred
Published
Sep 23, 2026, 5:17 PM
Modified
Sep 23, 2026, 6:17 PM