/

CVE-2026-96758

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in Orval Form-Data Serializer

CVE-2026-96758

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code Execution

Severity:

CRITICAL RISK

(9.8)

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

A critical code injection vulnerability in Orval's form-data serializer fails to escape multipart property names when generating client code from OpenAPI schemas. If an attacker can influence schema property names, injected template expressions may execute with the privileges of the process that builds FormData request bodies.

Affected context

The vulnerability occurs in Orval versions before 8.28.0 when the code generator processes OpenAPI schemas containing attacker-controlled multipart property names. It becomes risky when generated template literals incorporate those names without escaping and the resulting client code later evaluates the injected interpolation in a consumer's build or runtime process.

Exploit preconditions

  • Attack surface: OpenAPI schema processing and generated form-data client code
  • Required access: Ability to introduce or influence property names in an OpenAPI schema, directly or through a trusted schema supply chain
  • Trigger point: Generation or execution of code that builds FormData bodies using the affected serializer
  • Why exploitation is possible: Multipart property names are inserted into template literals without escaping, allowing ${...} expressions to be interpreted as live JavaScript interpolation

Why this happens

The underlying bug is failure to treat schema-derived property names as untrusted data before embedding them in generated template literals. Because template literal delimiters and interpolation syntax are not escaped, attacker-controlled names can alter generated program structure and cause expressions to execute. This behavior maps to CWE-94: Improper Control of Generation of Code, where input data influences executable source code.

Potential impact

  • Arbitrary JavaScript execution in the client-generation or consuming process
  • Exposure of environment variables, source code, credentials, or build artifacts
  • Modification of generated files or downstream application behavior
  • Compromise of CI/CD agents or developer workstations running affected generation workflows
  • Supply-chain propagation through trusted but tampered OpenAPI specifications

General mitigation guidance

Mitigation generally focuses on separating schema data from generated code and reducing trust in externally sourced specifications.

Common defensive patterns include:

  • Escaping or safely encoding all schema-derived values before placing them in generated source
  • Prefering generation APIs and serialization techniques that do not require dynamic template interpolation
  • Validating OpenAPI property names against an appropriate schema and rejecting unexpected control syntax
  • Treating specifications from external or semi-trusted sources as untrusted build inputs
  • Running code generation with least-privilege identities, isolated build environments, and minimal secret access
  • Reviewing generated output before compilation or publication

How teams detect issues like this

Organizations can identify this class of issue through:

  • Static analysis rules that flag unescaped schema values embedded in template literals
  • Code review checks for dynamic source generation involving ${...} or equivalent interpolation syntax
  • Tests using property names containing template delimiters and other metacharacters
  • Dependency and policy checks for generator components that process untrusted OpenAPI documents
  • CI validation that compares generated output against expected safe patterns and prevents unexpected executable constructs

Automated code review and software composition analysis tools may help surface related patterns.

Sources

SourceLink
github.comgithub.com/orval-labs/orval
github.comgithub.com/orval-labs/orval/blob/v8.27.0/packages/core/src/getters/res-req-types.ts#L808
github.comgithub.com/orval-labs/orval/commit/975a769a76151354dead879feadfa3537ff065fe
github.comgithub.com/orval-labs/orval/pull/3988
github.comgithub.com/orval-labs/orval/security/advisories/GHSA-jwhm-6748-j6pq
vulncheck.comvulncheck.com/advisories/orval-orval-core-before-8.28.0-code-injection-via-form-data

Frequently asked

questions

It is not necessarily a network-service vulnerability. Exploitation generally requires an attacker to influence an OpenAPI schema that is processed by a vulnerable generator or consumed in a vulnerable generated client workflow.

The attacker needs a path to modify, submit, or cause adoption of an OpenAPI schema containing malicious multipart property names. The resulting generated code must also be built or executed by a consumer process.

Treat schema-derived names as data, not source code: use context-appropriate escaping or structured generation methods that prevent property names from becoming executable template expressions.

Apply strict input trust boundaries, test code generators with adversarial identifiers, review generated source in CI, and run generation with minimal privileges and limited access to secrets.

Find out what's already
exploitable in your codebase.