mcp-cve-project

CVE-2026-22785 | @orval/mcp (OpenAPI MCP server codegen injection) | Critical | 9.8

CVE Information

Field Value
CVE / NVD CVE-2026-22785
EPSS score 0.000420000 (FIRST EPSS, 2026-05-29)
Date (index) 2026-01-12
Affected product (index) @orval/mcp (Orval MCP server generation from OpenAPI)
GHSA ID GHSA-mwr6-3gp8-9jmj
OWASP MCP Top 10 (2025) MCP05 — Command Injection & Execution
Published / disclosed 2026-01-12
Ecosystem npm
Component @orval/mcp MCP server generation
CVSS score 9.8 CVSS v3.1 (NVD) / Critical CVSS v4.0 (GitHub CNA)
CWE CWE-77
Affected versions < 7.18.0
Fixed versions 7.18.0
Fix status Patched
Exploit status Public advisory
Notes Added during the 2026-05-29 NVD gap review. Malicious OpenAPI summary fields can break out of generated string literals during MCP server codegen.

CVE Breakdown


What is the vulnerability?

orval generates type-safe TypeScript clients from OpenAPI specifications. Prior to 7.18.0, the MCP server generation logic incorporates the OpenAPI summary field into generated code via string manipulation without proper validation or escaping. An attacker who can supply or influence the OpenAPI document can break out of string literals and inject arbitrary code into generated MCP server output.

Attack prerequisites / exposure

The victim runs Orval against attacker-controlled or poisoned OpenAPI YAML/JSON (supply-chain document, compromised spec repo, or untrusted third-party API definition). No network authentication is required at generation time.

CVE is because of what bug?

Command/code injection (CWE-77) from unsanitized OpenAPI metadata embedded in generated MCP server source.

MCP-specific impact / why it matters

MCP server scaffolding turns API metadata into executable TypeScript. A poisoned spec becomes a build-time RCE path for every developer or CI job that runs Orval MCP generation on it.

Where was the bug? (source + snippet)

Review orval-labs/orval MCP server generation templates; summary field concatenation without escaping.

Fix / Remediation

Upgrade orval to 7.18.0 or later. Review OpenAPI inputs before running the Orval CLI in CI; treat third-party specs as untrusted.

Upstream fix (open source)

Workarounds / mitigations

Exploit / PoC

Public advisory; do not host weaponized OpenAPI payloads in this repository.

Detection / verification

Patch

Upgrade to orval 7.18.0 or later.