Vulnerabilities in pkg:npm/orval

PACKAGE
Advisory Identifier: GHSA-fg9p-mrxr-hvq7
Advisory Summary

CVE-2026-62681 is a CRITICAL remote code execution vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Orval libraries in the npm ecosystem. The issue involves rce via openapi path -> unescaped request-url template literal (backtick breakout). Remediation is available by upgrading affected packages to version 8.21.0.

12 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/orval

12 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/orval. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-fg9p-mrxr-hvq7 CVE-2026-62681 CRITICAL Orval: RCE via OpenAPI path -> unescaped request-URL template literal (backtick breakout)
GHSA-88f2-fpv8-89q2 CVE-2026-62682 CRITICAL Orval: RCE via servers[].url -> unescaped request-URL template literal (with getBaseUrlFromSpecification)
GHSA-w727-8j6c-2rj4 CVE-2026-72717 CRITICAL Orval: Import-time RCE via schema default -> zod module-level template literal
GHSA-2h9g-j24r-h63g CVE-2026-71869 CRITICAL Orval: Import-time RCE via array-items default -> zod module-level template literal
GHSA-8j6p-r8jg-mxqh CVE-2026-71871 CRITICAL Orval: Import-time RCE via header-parameter default -> zod module-level template literal
GHSA-2w86-xfrc-g85r CVE-2026-71867 CRITICAL Orval: RCE via schema property name -> computed-property-key injection in the MSW mock generator
GHSA-3575-w9fc-c2j6 CVE-2026-71868 CRITICAL Orval: Import-time RCE via enum-typed default -> zod module-level template literal
GHSA-653q-5476-x79g CVE-2026-71865 CRITICAL Orval: Import-time RCE via query parameter name -> computed-property-key injection in the zod cli
GHSA-6437-gxhq-pqv8 CVE-2026-71864 CRITICAL Orval: Import-time RCE via header parameter name -> computed-property-key injection in the zod client
GHSA-cxq5-97v7-87j8 CVE-2026-62680 HIGH Orval: Generation-time SSRF + remote/local file inclusion via unrestricted $ref
GHSA-p4cg-3328-rvfg CVE-2026-72716 CRITICAL Orval: Import-time RCE via query-parameter default -> zod module-level template literal
GHSA-6mr6-jvcr-2f25 CVE-2026-71866 CRITICAL Orval: Import-time RCE via schema property name -> computed-property-key injection in the zod client

CVE-2026-62681 at a Glance

CVE Identifier CVE-2026-62681
GHSA Identifier GHSA-fg9p-mrxr-hvq7
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Orval
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-62681

To remediate this vulnerability, upgrade all affected Orval dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

orval fixed: 8.21.0
npm install orval@8.21.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls orval

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-62681, inspect your project dependencies using npm:

npm ls orval

Analyze the terminal output to locate any version of Orval in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.21.0), your application is affected.

Note: The npm ls orval command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Orval, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Orval emits the OpenAPI path into the generated request URL as a TEMPLATE LITERAL (`` `/users/...` ``) without escaping the backtick character. A path containing a backtick closes the template literal and injects a concatenation expression that is evaluated when the generated URL/request/key function is called, executing attacker-controlled code. Affects the axios, fetch, react-query, and swr clients. Verified on Orval 8.19.0; survives Orval's default OpenAPI validation. ### Details ```ts // generated URL builder (fetch client) return `/users/` + (globalThis.X = require("fs").writeFileSync("/marker","pwned")) + `/list`; ``` The backtick in the path terminates the `` `...` `` literal; `+ (<code>) +` runs as a live expression; a trailing backtick reopens a template literal so the file stays valid. The code runs whenever the generated request function, URL builder, or query-key function is called. This is distinct from Orval's four published CVEs: CVE-2026-22785 (`summary` -> MCP server), CVE-2026-23947 / CVE-2026-25141 (`x-enumDescriptions`), and CVE-2026-24132 (`const` -> mock files). This is a different field (the route path) and a different sink (the request-URL template literal), which those advisories and their fixes do not cover. ### PoC `reproduce.sh` (+ `make_spec.py`) attached: generates a fetch client with default validation, bundles it, calls the generated functions, and shows a marker file written. Verified on 8.19.0. ### Impact Code execution in any environment that calls a client generated from an attacker-controlled or attacker-influenced OpenAPI description (developer, CI, or the running application). ### Suggested fix Escape the path before emitting it into the URL template literal (escape backtick and `${`, or build the URL with an encoder that treats the path as data), and validate path characters.

CVE-2026-62681 Affected Orval Versions

1 component(s)
Fixed Versions:
8.21.0
Product / Package Ecosystem Affected Versions Fixed Version
orval
npm
< 8.21.0
8.21.0

References

Frequently Asked Questions

What is CVE-2026-62681?
CVE-2026-62681 is a security vulnerability in Orval involving RCE via OpenAPI path -> unescaped request-URL template literal (backtick breakout) under CWE-116: Improper Encoding or Escaping of Output.
Which Orval versions are affected?
Affected versions include releases prior to 8.21.0 across affected packages: orval.
What version fixes CVE-2026-62681?
Upgrading to 8.21.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is orval affected?
Yes, orval is affected in releases prior to 8.21.0. Upgrade your dependency to 8.21.0 or later.
What CWE is associated with CVE-2026-62681?
CVE-2026-62681 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check npm dependencies for CVE-2026-62681?
Run the dependency tree command: 'npm ls orval'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fg9p-mrxr-hvq7",
  "modified" : "2026-09-03T19:17:32Z",
  "published" : "2026-09-03T19:17:32Z",
  "aliases" : [ "CVE-2026-62681" ],
  "summary" : "Orval: RCE via OpenAPI path -> unescaped request-URL template literal (backtick breakout)",
  "details" : "### Summary\n\nOrval emits the OpenAPI path into the generated request URL as a TEMPLATE LITERAL (`` `/users/...` ``) without escaping the backtick character. A path containing a backtick closes the template literal and injects a concatenation expression that is evaluated when the generated URL/request/key function is called, executing attacker-controlled code. Affects the axios, fetch, react-query, and swr clients. Verified on Orval 8.19.0; survives Orval's default OpenAPI validation.\n\n### Details\n\n```ts\n// generated URL builder (fetch client)\nreturn `/users/` + (globalThis.X = require(\"fs\").writeFileSync(\"/marker\",\"pwned\")) + `/list`;\n```\n\nThe backtick in the path terminates the `` `...` `` literal; `+ (<code>) +` runs as a live expression; a trailing backtick reopens a template literal so the file stays valid. The code runs whenever the generated request function, URL builder, or query-key function is called.\n\nThis is distinct from Orval's four published CVEs: CVE-2026-22785 (`summary` -> MCP server), CVE-2026-23947 / CVE-2026-25141 (`x-enumDescriptions`), and CVE-2026-24132 (`const` -> mock files). This is a different field (the route path) and a different sink (the request-URL template literal), which those advisories and their fixes do not cover.\n\n### PoC\n\n`reproduce.sh` (+ `make_spec.py`) attached: generates a fetch client with default validation, bundles it, calls the generated functions, and shows a marker file written. Verified on 8.19.0.\n\n### Impact\n\nCode execution in any environment that calls a client generated from an attacker-controlled or attacker-influenced OpenAPI description (developer, CI, or the running application). \n\n### Suggested fix\n\nEscape the path before emitting it into the URL template literal (escape backtick and `${`, or build the URL with an encoder that treats the path as data), and validate path characters.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "orval"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.21.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/security/advisories/GHSA-fg9p-mrxr-hvq7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-62681"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/pull/3692"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/commit/8ef1bfdf3f9bcaf9dabfbe2e42887f1c0e159ab6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/orval-labs/orval"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/orval-labs/orval/releases/tag/v8.21.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-1336", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-03T19:17:32Z",
    "nvd_published_at" : "2026-08-19T18:16:54Z"
  }
}