VYPR
Critical severityOSV Advisory· Published Jan 12, 2026· Updated Jan 12, 2026

orval MCP client is vulnerable to a code injection attack.

CVE-2026-22785

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.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
@orval/mcpnpm
< 7.18.07.18.0

Affected products

1

Patches

1
80b5fe73b94f

fix(mdp): Sanitize strings before passing to MCP tool

https://github.com/orval-labs/orvalmellowareJan 10, 2026via ghsa
1 file changed · +11 10
  • packages/mcp/src/index.ts+11 10 modified
    @@ -12,6 +12,7 @@ import {
       getFileInfo,
       getFullRoute,
       jsDoc,
    +  jsStringEscape,
       NormalizedOutputOptions,
       pascal,
       upath,
    @@ -184,30 +185,30 @@ export const generateServer = async (
     
       const toolImplementations = Object.values(verbOptions)
         .map((verbOption) => {
    -      const imputSchemaTypes = [];
    +      const inputSchemaTypes = [];
           if (verbOption.params.length > 0)
    -        imputSchemaTypes.push(
    +        inputSchemaTypes.push(
               `  pathParams: ${verbOption.operationName}Params`,
             );
           if (verbOption.queryParams)
    -        imputSchemaTypes.push(
    +        inputSchemaTypes.push(
               `  queryParams: ${verbOption.operationName}QueryParams`,
             );
           if (verbOption.body.definition)
    -        imputSchemaTypes.push(`  bodyParams: ${verbOption.operationName}Body`);
    +        inputSchemaTypes.push(`  bodyParams: ${verbOption.operationName}Body`);
     
    -      const imputSchemaImplementation =
    -        imputSchemaTypes.length > 0
    +      const inputSchemaImplementation =
    +        inputSchemaTypes.length > 0
               ? `  {
    -  ${imputSchemaTypes.join(',\n  ')}
    +  ${inputSchemaTypes.join(',\n  ')}
       },`
               : '';
     
           const toolImplementation = `
     server.tool(
    -  '${verbOption.operationName}',
    -  '${verbOption.summary}',${imputSchemaImplementation ? `\n${imputSchemaImplementation}` : ''}
    -  ${verbOption.operationName}Handler
    +  '${jsStringEscape(verbOption.operationName)}',
    +  '${jsStringEscape(verbOption.summary)}',${inputSchemaImplementation ? `\n${inputSchemaImplementation}` : ''}
    +  ${jsStringEscape(verbOption.operationName)}Handler
     );`;
     
           return toolImplementation;
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.