CVE-2026-62682: Orval code injection via unescaped server URL in template literal

CVE-2026-62682 · Severity: critical · CVSS 4 · Published 2026-08-19

Orval is a code generator that creates API clients from OpenAPI specifications. When configured to extract the base URL from the OpenAPI spec's `servers[].url` field, Orval fails to escape backticks and template expressions, allowing an attacker who controls the OpenAPI specification to inject and execute arbitrary JavaScript code in any application that uses the generated client. This affects teams integrating untrusted or attacker-influenced API specifications into their build pipeline.

Technologies: orval (npm). Vendors: npm.

Quick answers

Is CVE-2026-62682 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-62682 being exploited in the wild.
How severe is CVE-2026-62682?
Critical severity, with a CVSS score of 4, published 19 August 2026.
Which products and versions are affected?
orval (npm) < 8.21.0, SEMVER:introduced=0,fixed=8.21.0.
Is there a fix for CVE-2026-62682?
Yes. orval (npm): upgrade to 8.21.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-62682 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-62682?
Check whether you run orval (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • orval (npm): upgrade to 8.21.0 or later
    npm install orval@8.21.0

Technical details

Orval generates HTTP client code with URL construction using JavaScript template literals. When the `output.baseUrl.getBaseUrlFromSpecification: true` option is enabled, the server URL from the OpenAPI specification's `servers[0].url` field is embedded directly into a template literal without escaping backticks or `${` sequences. An attacker who can influence the OpenAPI specification (via a malicious endpoint, compromised registry, or supply-chain attack) can inject a backtick followed by arbitrary JavaScript expressions, which closes the template literal and allows code injection. For example, a server URL like `` `http://api.x/` + (globalThis.X = require("fs").writeFileSync("/marker","pwned")) + `/v1/u` `` will execute the injected code when the generated client functions are called. The vulnerability requires the specific configuration option to be enabled, but no authentication is needed and the attack succeeds even with default OpenAPI validation. Patches are available in version 8.21.0 and later; the fix involves properly escaping the server URL before embedding it into the template literal or validating the URL structure.

Affected products

  • orval-labs orval < 8.21.0

Identifiers

  • CVE-2026-62682
  • GHSA-88f2-fpv8-89q2

Timeline

  • 2026-07-12: disclosed: Vulnerability initially published to GitHub Advisory Database
  • 2026-08-19: advisory: Published to National Vulnerability Database (NVD)
  • 2026-09-03: advisory: GitHub Advisory review completed and published
  • 2026-09-03: patched: Patch released in Orval v8.21.0 (commit 8ef1bfd)

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.