CVE-2026-25141

Orval has a code injection via unsanitized x-enum-descriptions uing JS comments

Published Jan 30, 2026 CVSS 4.0 · 9.3 Critical EPSS < 1% KEV · Not listed
Description
Orval generates type-safe JS clients (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification. Versions starting with 7.19.0 and prior to 7.21.0 and 8.2.0 have an incomplete fix for CVE-2026-23947. While the jsStringEscape function properly handles single quotes ('), double quotes (") and so on, it is still possible to achieve code injection using only a limited set of characters that are currently not escaped. The vulnerability lies in the fact that the application can be forced to execute arbitrary JavaScript using characters such as []()!+. By using a technique known as JSFuck, an attacker can bypass the current sanitization logic and run arbitrary code without needing any alphanumeric characters or quotes. Version 7.21.0 and 8.2.0 contain an updated fix.

Analysis

AI-generated

Technical impact

This vulnerability allows an attacker to inject arbitrary JavaScript into the code generated by Orval. By supplying specially crafted values in the x‑enum‑descriptions field of an OpenAPI specification, the unsanitized string builder can be made to produce a JSFuck expression that bypasses the existing escape logic. The resulting injected code is then executed in the context where the generated client is used, potentially yielding full control of the application running the client. The flaw is a classic code‑injection weakness (CWE‑94) and can compromise confidentiality, integrity, and availability if the generated code is deployed in a trusted environment.

Affected Systems

The affected product is Orval from orval-labs. Versions 7.19.0 through 7.20.x and 8.0.0 through 8.1.x are vulnerable, as these released before the comprehensive fix that appears in 7.21.0 and 8.2.0. All earlier or later releases are not impacted unless they contain the same escape logic.

Risk and Exploitability

The CVSS v3.1 base score of 9.3 indicates high severity, while the EPSS score of less than 1% shows a very low likelihood that the flaw is being exploited in the wild at present. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires an attacker who can supply or influence a malformed OpenAPI specification that is processed by Orval, such as a compromised CI pipeline or malicious code generator. Once the vulnerable code is generated, arbitrary JavaScript can run in the browser or Node.js environment where the client is loaded.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Orval to version 7.21.0 or later, or to 8.2.0 or later, which contain the complete fix for this injection issue.
  • If an upgrade is not immediately possible, locate the jsStringEscape function in the codebase and apply the patch that properly escapes all special characters used in JSFuck expressions.
  • Validate or sanitize all x‑enum‑descriptions values in incoming OpenAPI specifications to ensure they do not contain characters that can form a malicious JavaScript expression.

Generated by OpenCVE AI on April 18, 2026 at 01:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-gch2-phqh-fg9q Orval has Code Injection via unsanitized x-enum-descriptions using JS comments
History
Type Values Removed Values Added
First Time appeared Orval
Orval orval
CPEs cpe:2.3:a:orval:orval:*:*:*:*:*:*:*:*
Vendors & Products Orval
Orval orval
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'}

Type Values Removed Values Added
First Time appeared Orval-labs
Orval-labs orval
Vendors & Products Orval-labs
Orval-labs orval
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
Description Orval generates type-safe JS clients (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification. Versions starting with 7.19.0 and prior to 7.21.0 and 8.2.0 have an incomplete fix for CVE-2026-23947. While the jsStringEscape function properly handles single quotes ('), double quotes (") and so on, it is still possible to achieve code injection using only a limited set of characters that are currently not escaped. The vulnerability lies in the fact that the application can be forced to execute arbitrary JavaScript using characters such as []()!+. By using a technique known as JSFuck, an attacker can bypass the current sanitization logic and run arbitrary code without needing any alphanumeric characters or quotes. Version 7.21.0 and 8.2.0 contain an updated fix.
Title Orval has a code injection via unsanitized x-enum-descriptions uing JS comments
Weaknesses CWE-94
References
Metrics 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
GitHub_M
Published
Updated
Feb 2, 2026, 6:00 PM
Reserved
Jan 29, 2026, 3:39 PM
Status
Analyzed
Published
Jan 30, 2026, 9:15 PM
Modified
Jun 17, 2026, 10:24 AM