CVE-2026-23947: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-23947 is a critical code injection vulnerability in Orval, a tool that generates type-safe TypeScript/JavaScript clients from OpenAPI v3 or Swagger v2 specifications. The flaw resides in the @orval/core package and allows untrusted OpenAPI specifications to inject arbitrary TypeScript/JavaScript code into generated clients via the x-enumDescriptions field, which is embedded without proper escaping in the getEnumImplementation() function. Affected versions include all releases prior to 7.19.0 and versions 8.0.0-rc.0 through 8.0.2 (exclusive). The vulnerability was published on January 19–20, 2026. It carries a CVSS v3.1 score of 9.8 (Critical) and a CVSS v4.0 score of 9.3 (Critical) (Github Advisory, Red Hat CVE).

Technical details

The root cause is improper neutralization of special elements during code generation (CWE-77, CWE-94): the getEnumImplementation() function in @orval/core directly embeds values from the x-enumDescriptions OpenAPI extension field into generated TypeScript const enum blocks without sanitization or escaping. An attacker crafts a malicious OpenAPI specification containing a payload such as "pwned */ require('child_process').execSync('id'); /*" in the x-enumDescriptions array, which breaks out of the JSDoc comment context and injects executable JavaScript. The injection occurs at code-generation time, meaning the malicious code is written into the generated schema files and subsequently executed when those files are consumed by downstream applications. This is a distinct code path from the previously patched CVE-2026-22785 and was not addressed by that fix (Github Advisory, Orval Security Advisory).

Impact

Successful exploitation results in arbitrary code execution within any environment that consumes Orval-generated client files, leading to full compromise of confidentiality, integrity, and availability of the affected application. An attacker can exfiltrate sensitive data, modify or delete application data, and disrupt service availability — all without requiring authentication or user interaction. The supply-chain nature of this attack means that a single malicious OpenAPI specification can propagate injected code to all downstream consumers of the generated clients, significantly amplifying the blast radius (Github Advisory, Red Hat CVE).

Exploitability

A public proof-of-concept exploit is available on GitHub at https://github.com/boroeurnprach/CVE-2026-23947-PoC, published shortly after disclosure (Feedly). As of the time of reporting, there is no confirmed evidence of active in-the-wild exploitation. The EPSS score is approximately 0.05% (16th percentile), indicating a currently low but non-negligible probability of exploitation in the near term (Github Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. No specific threat actor attribution has been reported. The vulnerability is detectable by Qualys scanner (detection ID: 5007113).

Exploitation steps

  1. Craft a malicious OpenAPI specification: Create a valid OpenAPI 3.x YAML or JSON file that defines an enum schema with a weaponized x-enumDescriptions entry. For example:
components:
  schemas:
    EvilEnum:
      type: string
      enum:
        - PWNED
      x-enumDescriptions:
        - "pwned */ require('child_process').execSync('id'); /*"
  1. Deliver the specification to the target: Position the malicious OpenAPI spec so that a developer or CI/CD pipeline using Orval will consume it — e.g., by hosting it on a compromised API server, submitting it via a pull request, or substituting it in a supply chain context.
  2. Trigger Orval code generation: When the victim runs Orval against the malicious spec (e.g., orval --config orval.config.ts), the getEnumImplementation() function in @orval/core embeds the unsanitized x-enumDescriptions value directly into the generated TypeScript schema file.
  3. Injected code executes: The generated schema file now contains executable JavaScript outside the intended JSDoc comment block. When the generated file is imported or executed by Node.js (e.g., during build, test, or runtime), the injected payload (e.g., require('child_process').execSync('id')) runs with the privileges of the consuming process.
  4. Achieve objective: The attacker's payload executes arbitrary commands — enabling data exfiltration, reverse shell establishment, persistence, or further lateral movement within the environment (Github Advisory, Orval Security Advisory).

Indicators of compromise

  • File System: Generated TypeScript/JavaScript schema files containing unexpected require('child_process'), execSync, exec, spawn, or other Node.js process execution calls outside of comment blocks; presence of unexpected .js or .ts files with obfuscated or encoded payloads in the Orval output directory.
  • Process: Unexpected child processes spawned by the Node.js runtime during build or test execution (e.g., sh, bash, cmd.exe, curl, wget, powershell) as children of the node process.
  • Network: Unexpected outbound network connections from the build server or developer workstation to unknown external IPs or domains, particularly during or immediately after Orval code generation runs.
  • Logs: Build or CI/CD pipeline logs showing unexpected command output (e.g., uid=, user/group information) interleaved with normal Orval generation output; Node.js error stack traces referencing getEnumImplementation in @orval/core.
  • File System: Presence of the PoC repository (CVE-2026-23947-PoC) or related artifacts on developer machines; unexpected modifications to package.json or package-lock.json adding new dependencies after a code generation step (Github Advisory).

Mitigation and workarounds

Upgrade Orval to version 7.19.0 (for the v7 branch) or 8.0.2 (for the v8 branch), both of which contain the fix for this vulnerability — specifically the commit that ensures x-enum values are properly JS-escaped before being embedded in generated code (Github Advisory, Orval v8.0.2 Release). As an interim workaround, restrict Orval to processing only OpenAPI specifications from fully trusted, internally controlled sources, and implement validation/review of any third-party or externally sourced specs before use. Organizations should also audit any previously generated client files produced by affected versions for signs of injected code.

Community reactions

Security Online Info published a supply chain alert highlighting the critical CVSS 9.3 score and the code injection risk (Security Online). Endor Labs discussed the vulnerability in the context of AI infrastructure and MCP security, noting the broader implications for supply chain security (Endor Labs). A dev.to post titled "CVE-2026-23947: Comment Injection to RCE — Breaking Orval with JSDoc" provided a technical walkthrough of the exploitation mechanism (dev.to). The Secret CISO newsletter also covered the disclosure as part of broader supply chain security concerns.

Additional resources


Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-w2vw-w76x-qr89HIGH8.5
  • JavaScript logoJavaScript
  • nx
NoYesOct 05, 2026
CVE-2026-104852HIGH8.2
  • JavaScript logoJavaScript
  • @graphql-tools/utils
NoYesOct 05, 2026
GHSA-g7fw-3gjp-g5hfMEDIUM6.5
  • JavaScript logoJavaScript
  • @openclaw/matrix
NoYesOct 05, 2026
GHSA-r4xh-jqrq-34v2MEDIUM5.3
  • JavaScript logoJavaScript
  • smol-toml
NoYesOct 05, 2026
GHSA-6688-9rhm-gjv2LOWN/A
  • JavaScript logoJavaScript
  • dompurify
NoYesOct 05, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management