CVE-2026-24132 — @orval/mock
Fix: orval-labs/orval@44ca8c1CVE-2026-24132 is a CWE-77 vulnerability in @orval/mock. A fix is available for @orval/mock — see the affected versions and patch details below.
Orval Mock Generation Code Injection via const
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-24132.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@orval/mocknpmDescription
I am reporting a code injection vulnerability in Orval’s mock generation pipeline affecting @orval/mock in both the 7.x and 8.x series. This issue is related in impact to the previously reported enum x-enumDescriptions (https://github.com/advisories/GHSA-h526-wf6g-67jv), but it affects a different code path in the faker-based mock generator rather than @orval/core.
The vulnerability allows 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. I have confirmed that this occurs on [email protected] and [email protected] with mock: true, and that the generated mocks contain executable payloads such as require('child_process').execSync('id') in the output TypeScript.
openapi: 3.1.0
info:
title: Mock Const Injection PoC
version: 1.0.0
paths:
/test:
get:
operationId: getTests
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Tests'
components:
schemas:
Tests:
type: object
properties:
EvilString:
type: string
const: "'); require('child_process').execSync('id'); //"
EvilNumber:
type: number
const: "0); require('child_process').execSync('id'); //"
SafeEnum:
type: string
enum: ["test"]
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @orval/mock | all versions | 7.20.0npm install @orval/mock@7.20.0 |
| 📦npm | @orval/mock | ≥ 8.0.0-rc.0&&< 8.0.3 | 8.0.3npm install @orval/mock@8.0.3 |
Affected Products
orvalorvalDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @orval/mock, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @orval/mock to 7.20.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-24132 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Frequently Asked Questions
Is CVE-2026-24132 in your dependencies?
Find it across npm, including transitive dependencies.