/

CVE-2026-96755

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in Orval @orval/effect Generator

CVE-2026-96755

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary JavaScript 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 @orval/effect generator allows attacker-controlled OpenAPI schema defaults to introduce JavaScript expressions into generated template literals. When the generated code is built or imported, those expressions may execute with the privileges of the build or consuming application process.

Affected context

The vulnerability occurs in Orval configurations that use the @orval/effect generator and process OpenAPI schemas containing untrusted or insufficiently constrained default values. Risk increases when generated source is built, loaded, or imported automatically in a development, CI, package-generation, or application runtime environment.

Exploit preconditions

  • Attack surface: OpenAPI schema processing and generated JavaScript source
  • Required access: Ability to influence a schema or its default values that the generator consumes
  • Trigger point: Generation, build, or import of the affected output
  • Why exploitation is possible: Schema defaults are incorporated into template literals without adequately treating their contents as data, allowing expressions to be evaluated in the generated module context

Why this happens

The underlying bug is a failure to distinguish schema data from executable JavaScript syntax. The @orval/effect generator converts OpenAPI defaults into template literals without sufficiently escaping or safely representing expression delimiters. As a result, attacker-controlled content can alter the generated program and execute at module scope, which maps to CWE-94: Improper Control of Generation of Code ('Code Injection').

Potential impact

  • Arbitrary JavaScript code may execute in the build or consuming process
  • Source code, credentials, tokens, or environment data could be exposed
  • CI runners, developer workstations, or application environments could be compromised
  • Generated artifacts may be modified or backdoored
  • Downstream users may receive tampered packages or source files

General mitigation guidance

Mitigation generally focuses on preserving the boundary between OpenAPI data

and generated code.

Common defensive patterns include:

  • Representing schema defaults as serialized data rather than interpolated source expressions
  • Escaping or encoding template-literal and expression delimiters before code generation
  • Applying strict schema validation and trust controls to imported OpenAPI documents
  • Separating generation from automatic execution or import of newly generated code
  • Running generators and builds with least-privilege accounts, isolated environments, and minimal secrets
  • Reviewing generated artifacts before publication or deployment

How teams detect issues like this

Organizations can identify related risks through:

  • Static analysis for template interpolation of schema-derived or otherwise untrusted values
  • Code review checks for generated source that embeds data directly into JavaScript expressions
  • Tests using boundary characters and expression-like input to verify that output remains inert data
  • CI policies that inspect generated artifacts for unexpected executable constructs
  • Dependency and build-pipeline monitoring for changes to generator inputs and outputs

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

Sources

SourceLink
github.comgithub.com/orval-labs/orval
github.comgithub.com/orval-labs/orval/blob/v8.28.1/packages/effect/src/index.ts#L298-L302
github.comgithub.com/orval-labs/orval/commit/d346d94a660e50a2f8d0f7c17fee2c4c69d8dc23
github.comgithub.com/orval-labs/orval/pull/3995
github.comgithub.com/orval-labs/orval/security/advisories/GHSA-q7f2-jg6j-r867
vulncheck.comvulncheck.com/advisories/orval-orval-effect-8.14.0-through-8.28.1-code-injection

Frequently asked

questions

It is generally dependent on the ability to influence an OpenAPI schema or

default value consumed by the generator. A remote attack may be possible when

schemas are fetched from or accepted through an externally controlled source

and generation occurs automatically.

Direct host access is not necessarily required. The important condition is

control over generator input, combined with a build or import process that

evaluates the resulting JavaScript.

Treat schema defaults strictly as data: serialize them safely, neutralize

JavaScript expression syntax, and validate generated output before it is

built, imported, or distributed.

Use trusted schema sources, apply allowlisted validation, test generated code

with adversarial input, isolate generation jobs, and enforce least privilege

for build and package-publication environments.

Find out what's already
exploitable in your codebase.