/

CVE-2026-62680

Severity:

HIGH RISK

(7.1)

Path Traversal (CWE-22) in Orval External Ref Loader

CVE-2026-62680

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-829, CWE-918

Impact:

Local File Disclosure and Server-Side Request Forgery

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Orval versions before 8.22.0 resolve external OpenAPI and Swagger references without sufficiently restricting their destinations. Processing an attacker-controlled API description may cause a developer or CI host to contact internal or attacker-selected services, read local files outside the intended input directory, or include untrusted schemas in generated clients.

Affected context

The issue occurs in Orval's external reference loading during OpenAPI v3 or Swagger v2 processing. Risk is present when a developer, build pipeline, or automated generation service processes an API specification that can be modified by an untrusted party, and when referenced resources are resolved without an allowlist or confinement to the specification's input directory.

Exploit preconditions

  • Attack surface: Orval's external $ref resolution in the specification import and client-generation workflow
  • Required access: Ability to provide or influence an OpenAPI or Swagger description processed by Orval
  • Trigger point: Loading remote or local external references during specification parsing
  • Why exploitation is possible: Reference targets are resolved without adequate destination allowlisting or path confinement, allowing requests to selected services and access to absolute or out-of-tree local paths

Why this happens

The underlying bug is unrestricted external resource resolution. A document-processing component treats reference locations supplied by input as trusted paths or URLs instead of applying an explicit policy for permitted schemes, hosts, and filesystem boundaries.

This maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because local references may escape the intended input directory. The behavior also relates to CWE-918: Server-Side Request Forgery for network retrieval and CWE-829: Inclusion of Functionality from Untrusted Control Sphere when untrusted schemas are incorporated into generated output.

Potential impact

  • The developer or CI host may make requests to internal or attacker-controlled services
  • Sensitive local files may be disclosed to the generation process or incorporated into output
  • Generated clients may contain attacker-controlled schemas or types
  • Build metadata, credentials, or network-service information could be exposed
  • Downstream applications may inherit unsafe or misleading generated code

General mitigation guidance

Mitigation generally focuses on reducing trust in external references and enforcing explicit resource-resolution boundaries.

Common defensive patterns include:

  • Allowing only approved URL schemes, hosts, and reference locations
  • Confining local reference resolution to a designated input directory
  • Rejecting absolute paths, parent-directory escapes, and unexpected redirects
  • Separating specification retrieval from code generation and reviewing retrieved content
  • Running generation in a least-privilege, network-restricted build environment
  • Treating generated artifacts and remote schemas as untrusted until validated
  • Applying strict schema and content validation before references are resolved or inlined

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis rules for filesystem access and HTTP requests driven by $ref values
  • Code review checks for missing URL allowlists, path canonicalization, and directory-boundary validation
  • Tests covering absolute paths, parent-directory traversal, redirects, non-HTTP schemes, and internal destinations
  • CI policies that isolate document-generation jobs from sensitive files and private network ranges
  • Network monitoring for unexpected outbound requests during client generation
  • Dependency and automated code-review tools that flag SSRF, path traversal, and untrusted resource inclusion patterns

Sources

SourceLink
github.comgithub.com/orval-labs/orval/commit/23786c056f4eba38c02bf2968677988dbbe4de10
github.comgithub.com/orval-labs/orval/pull/3723
github.comgithub.com/orval-labs/orval/releases/tag/v8.22.0
github.comgithub.com/orval-labs/orval/security/advisories/GHSA-cxq5-97v7-87j8

Frequently asked

questions

It can be triggered indirectly when a developer or CI service processes an attacker-controlled OpenAPI or Swagger document. Exploitation generally requires influence over the specification supplied to the generation workflow.

An attacker needs a way to provide or modify a processed API description, or to cause a trusted user or automation system to process one. Direct access to the Orval host is not necessarily required.

Treat external references as untrusted, permit only explicitly approved resources, and confine local resolution to a controlled directory. Network-restricted, least-privilege generation environments provide additional protection.

Combine strict reference validation with path canonicalization, URL and host allowlists, controlled redirects, isolated build jobs, and tests for local-file and internal-network access patterns.

Find out what's already
exploitable in your codebase.