CVE-2026-23947: @orval/core Orval Has A Code Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-h526-wf6g-67jv
CWE-94 CWE-77
Published
Advisory Summary

CVE-2026-23947 is a CRITICAL orval has a code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting @orval/core libraries in the npm ecosystem. The issue involves orval has a code injection via unsanitized x-enum-descriptions in enum generation. Remediation is available by upgrading affected packages to version 8.0.2, 7.19.0.

CVE-2026-23947 at a Glance

CVE Identifier CVE-2026-23947
GHSA Identifier GHSA-h526-wf6g-67jv
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product @orval/core
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-23947

To remediate this vulnerability, upgrade all affected @orval/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@orval/core fixed: 8.0.2
npm install @orval/core@8.0.2
@orval/core fixed: 7.19.0
npm install @orval/core@7.19.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @orval/core

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-23947, inspect your project dependencies using npm:

npm ls @orval/core

Analyze the terminal output to locate any version of @orval/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.0.2), your application is affected.

Note: The npm ls @orval/core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In @orval/core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Arbitrary code execution in environments consuming generated clients This issue is similar in nature to the recently-patched MCP vulnerability (CVE-2026-22785), but affects a different code path in @orval/core that was not addressed by that fix. The vulnerability 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 getEnumImplementation(). I have confirmed that the injection occurs during const enum generation and results in executable code within the generated schema files. ### Patches Upgrade to Orval 8.0.2 ### References An example OpenAPI showing the issue: ```yaml openapi: 3.0.4 info: title: Enum PoC version: "1.0.0" paths: /ping: get: operationId: ping responses: "200": description: ok content: application/json: schema: $ref: "#/components/schemas/EvilEnum" components: schemas: EvilEnum: type: string enum: - PWNED x-enumDescriptions: - "pwned */ require('child_process').execSync('id'); /*" ```

CVE-2026-23947 Affected @orval/core Versions

2 component(s)
Fixed Versions:
8.0.27.19.0
Product / Package Ecosystem Affected Versions Fixed Version
@orval/core
npm
≥ 8.0.0-rc.0
< 8.0.2
8.0.2
@orval/core
npm
< 7.19.0
7.19.0

References

Frequently Asked Questions

What is CVE-2026-23947?
CVE-2026-23947 is a security vulnerability in @orval/core involving Orval has a code injection via unsanitized x-enum-descriptions in enum generation under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which @orval/core versions are affected?
Affected versions include releases prior to 8.0.2, 7.19.0 across affected packages: @orval/core.
What version fixes CVE-2026-23947?
Upgrading to 8.0.2, 7.19.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @orval/core affected?
Yes, @orval/core is affected in releases prior to 8.0.2, 7.19.0. Upgrade your dependency to 8.0.2, 7.19.0 or later.
What CWE is associated with CVE-2026-23947?
CVE-2026-23947 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2026-23947?
Run the dependency tree command: 'npm ls @orval/core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h526-wf6g-67jv",
  "modified" : "2026-01-21T17:08:30Z",
  "published" : "2026-01-21T01:01:13Z",
  "aliases" : [ "CVE-2026-23947" ],
  "summary" : "Orval has a code injection via unsanitized x-enum-descriptions in enum generation",
  "details" : "### Impact\nArbitrary code execution in environments consuming generated clients\n\nThis issue is similar in nature to the recently-patched MCP vulnerability (CVE-2026-22785), but affects a different code path in @orval/core that was not addressed by that fix.\n\nThe vulnerability 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 getEnumImplementation(). I have confirmed that the injection occurs during const enum generation and results in executable code within the generated schema files.\n\n### Patches\nUpgrade to Orval 8.0.2\n\n### References\nAn example OpenAPI showing the issue:\n\n```yaml\nopenapi: 3.0.4\ninfo:\n  title: Enum PoC\n  version: \"1.0.0\"\n\npaths:\n  /ping:\n    get:\n      operationId: ping\n      responses:\n        \"200\":\n          description: ok\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/EvilEnum\"\n\ncomponents:\n  schemas:\n    EvilEnum:\n      type: string\n      enum:\n        - PWNED\n      x-enumDescriptions:\n        - \"pwned */ require('child_process').execSync('id'); /*\"\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@orval/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0-rc.0"
      }, {
        "fixed" : "8.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@orval/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.19.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/security/advisories/GHSA-h526-wf6g-67jv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-23947"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/commit/9e5d93533904936678ba93b5d20f6bca176a4e1e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/orval-labs/orval"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/releases/tag/v7.19.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/releases/tag/v8.0.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-21T01:01:13Z",
    "nvd_published_at" : "2026-01-20T01:15:57Z"
  }
}