# CVE-2026-22785: orval MCP client is vulnerable to a code injection attack.


- **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
- **Fix available:** Yes
- **Published:** 12 Jan 2026
- **Updated:** 12 Jan 2026
- **Also known as:** GHSA-mwr6-3gp8-9jmj

## What is CVE-2026-22785?

CVE-2026-22785 is a critical vulnerability in orval-labs orval, published on 12 Jan 2026. 

### Official description

orval generates type-safe JS clients (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification. Prior to 7.18.0, the MCP server generation logic relies on string manipulation that incorporates the summary field from the OpenAPI specification without proper validation or escaping. This allows an attacker to "break out" of the string literal and inject arbitrary code. This vulnerability is fixed in 7.18.0.

Weakness: CWE-77 (Improper Neutralization of Special Elements used in a Command)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@orval/mcp` | npm | All versions | 7.18.0 |
| `@orval/mcp` | npm | All versions | 7.18.0 |

Products: Orval Orval.

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

Upgrade @orval/mcp to 7.18.0 or later.

## Is CVE-2026-22785 being exploited?

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

Public exploit code:

- orval < 7.18.0 MCP 服务器代码注入（CVSS 9.3）复现与利用工具 (github_poc): https://github.com/langbyyi/CVE-2026-22785

## 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-23947](https://insights.sbomify.com/CVE-2026-23947/): Orval MCP client is vulnerable to code injection via unsanitized x-enum-descriptions in enum generation (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-22785 and fix it if it is affected.

What it is: CVE-2026-22785 is a critical vulnerability in orval-labs orval, published on 12 Jan 2026. 
Exploitation: There is no known exploitation of CVE-2026-22785 in the wild and no public exploit code.

Affected packages and fixed versions:
- @orval/mcp (npm): affected all versions; fixed in 7.18.0
- @orval/mcp (npm): affected all versions; fixed in 7.18.0

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-22785/ (Markdown: https://insights.sbomify.com/CVE-2026-22785/index.md)
```

## Sources

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

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