# CVE-2026-23947: Orval MCP client is vulnerable to code injection via unsanitized x-enum-descriptions in enum generation

> Attackers can inject arbitrary code into generated clients via malicious OpenAPI specs, leading to code execution in consuming environments.

- **Severity:** Critical 9.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Jan 2026
- **Updated:** 21 Jan 2026
- **Also known as:** GHSA-h526-wf6g-67jv

## What is CVE-2026-23947?

CVE-2026-23947 is a critical code injection vulnerability in orval-labs orval, published on 20 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Orval generates type-safe JS clients (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification. Versions prior to 7.19.0 until 8.0.2 are vulnerable to arbitrary code execution in environments consuming generated clients. This issue is similar in nature to CVE-2026-22785, but affects a different code path in @orval/core that was not addressed by CVE-2026-22785's 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. Orval 7.19.0 and 8.0.2 contain a fix for the issue.

Weakness: CWE-94 (Improper Control of Generation of Code), CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2026-23947?

4 open source packages ship an affected version, including @orval/core. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@orval/core` | npm | All versions | 7.19.0 |
| `@orval/core` | npm | All versions | 7.19.0 |
| `@orval/core` | npm | From 8.0.0-rc.0 | 8.0.2 |
| `@orval/core` | npm | From 8.0.0-rc.0 | 8.0.2 |

Products: Orval Orval.

## How do I fix CVE-2026-23947?

Upgrade @orval/core to a fixed version for your release line: 7.19.0 or 8.0.2.

## Is CVE-2026-23947 being exploited?

There is no known exploitation of CVE-2026-23947 in the wild and no public exploit code.

Public exploit code:

- CVE-2026-23947 - Orval Arbitrary Code Execution (github_poc): https://github.com/boroeurnprach/CVE-2026-23947-PoC

## Other vulnerabilities in orval-labs orval

- [CVE-2026-25141](https://insights.sbomify.com/CVE-2026-25141/): Orval has a code injection via unsanitized x-enum-descriptions uing JS comments (critical 9.3)
- [CVE-2026-22785](https://insights.sbomify.com/CVE-2026-22785/): orval MCP client is vulnerable to a code injection attack. (critical 9.3)
- [CVE-2026-24132](https://insights.sbomify.com/CVE-2026-24132/): Orval Mock Generation Code Injection via const (high 7.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-23947 and fix it if it is affected.

What it is: CVE-2026-23947 is a critical code injection vulnerability in orval-labs orval, published on 20 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-23947 in the wild and no public exploit code.

Affected packages and fixed versions:
- @orval/core (npm): affected all versions; fixed in 7.19.0
- @orval/core (npm): affected all versions; fixed in 7.19.0
- @orval/core (npm): affected from 8.0.0-rc.0; fixed in 8.0.2
- @orval/core (npm): affected from 8.0.0-rc.0; fixed in 8.0.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-23947/ (Markdown: https://insights.sbomify.com/CVE-2026-23947/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-23947
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-23947
- OSV: https://osv.dev/vulnerability/CVE-2026-23947

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-23947/
Summaries are generated and may contain mistakes; the official description above is the record.
