CVE-2026-23947: @orval/core Orval Has A Code Injection Vulnerability
CRITICALCVE-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
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.
npm install @orval/core@8.0.2
npm install @orval/core@7.19.0
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
CVE-2026-23947 Affected @orval/core Versions
2 component(s)| 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?
Which @orval/core versions are affected?
What version fixes CVE-2026-23947?
Is @orval/core affected?
What CWE is associated with CVE-2026-23947?
How can I check npm dependencies for CVE-2026-23947?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}