{"id":"CVE-2026-24132","published":"2026-01-22T23:47:45Z","modified":"2026-01-23T20:01:12Z","title":"Orval Mock Generation Code Injection via const","vendor":"orval-labs","product":"orval","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.7,"severity":"HIGH","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01113,"percentile":0.65613,"provenance":"source"},"cwes":[{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"}],"references":[{"url":"https://github.com/orval-labs/orval/security/advisories/GHSA-f456-rf33-4626","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/orval-labs/orval/pull/2828","tags":["x_refsource_MISC"]},{"url":"https://github.com/orval-labs/orval/pull/2829","tags":["x_refsource_MISC"]},{"url":"https://github.com/orval-labs/orval/pull/2830","tags":["x_refsource_MISC"]},{"url":"https://github.com/orval-labs/orval/commit/44ca8c1f5f930a3e4cefb6b79b38bcde7f8532a5","tags":["x_refsource_MISC"]},{"url":"https://github.com/orval-labs/orval/commit/6d8ece07ccb80693ad43edabccb3957aceadcd06","tags":["x_refsource_MISC"]},{"url":"https://github.com/orval-labs/orval/commit/9b211cddc9f009f8a671e4ac5c6cb72cd8646b62","tags":["x_refsource_MISC"]},{"url":"https://github.com/orval-labs/orval/releases/tag/v7.20.0","tags":["x_refsource_MISC"]},{"url":"https://github.com/orval-labs/orval/releases/tag/v8.0.3","tags":["x_refsource_MISC"]}],"priority":{"score":18.5,"factors":[{"name":"EPSS percentile","points":13.12},{"name":"CVSS severity","points":5.39}]},"vendorSlug":"orval-labs","affectedVersions":[{"vendor":"orval-labs","product":"orval","versions":["< 7.20.0",">= 8.0.0-rc.0, < 8.0.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-01-23T20:00:52.884919Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"@orval/mock","vulnerableRanges":["<7.20.0",">=8.0.0-rc.0, <8.0.3"],"patched":["7.20.0","8.0.3"],"from":["GHSA-f456-rf33-4626"],"provenance":"source"}],"summary":{"text":"Orval, the OpenAPI-to-TypeScript client generator from orval-labs, has a code injection flaw in its faker-based mock generator (getMockScalar), where the const keyword values in schema properties are interpolated into generated mock files without escaping. An attacker who can supply a malicious OpenAPI or Swagger specification and get it processed by Orval can cause arbitrary TypeScript or JavaScript to be emitted into the interface definitions and faker/MSW handlers, which requires the victim to run the generator against that untrusted specification (user interaction).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:10:13Z"},"euvd":{"id":"EUVD-2026-3783","exploited":false,"provenance":"source"}}