Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. swagger-typescript-api
  4. ›
  5. CVE-2026-54661

CVE-2026-54661: swagger-typescript-api vulnerable to code injection via unescaped `servers[0].url` in axios http-client template

July 29, 2026

swagger-typescript-api interpolates servers[0].url directly into a TypeScript string literal inside the HttpClient constructor body of the generated axios client (templates/base/http-clients/axios-http-client.ejs:71), without any escaping. A malicious URL containing a " closes the string literal and exposes the surrounding object-literal argument of axios.create({...}) to injection. A computed property key whose value is an IIFE executes arbitrary code every time new HttpClient() (or new Api(), which extends HttpClient) is constructed. The attacker controls the OpenAPI spec; the victim is any consumer of the generated client. Impact is arbitrary code execution with the importing process’s privileges.

This is the axios sibling of the previously reported fetch-client RCE — same upstream variable (apiConfig.baseUrl, sourced from servers[0].url), same root cause class (raw <%~ %> interpolation of unescaped spec strings), different template file and different lifecycle frame (constructor body vs class-body static field). The single most maintainable fix — sanitizing apiConfig.baseUrl once at the source in src/code-gen-process.ts:591 — closes both at once.

References

  • github.com/acacode/swagger-typescript-api/commit/306d59acb8ffbb00f953f807b97234b21f51d9de
  • github.com/acacode/swagger-typescript-api/pull/1779
  • github.com/acacode/swagger-typescript-api/releases/tag/v13.12.2
  • github.com/acacode/swagger-typescript-api/security/advisories/GHSA-38c3-wv3c-v3xj
  • github.com/advisories/GHSA-38c3-wv3c-v3xj
  • nvd.nist.gov/vuln/detail/CVE-2026-54661

Code Behaviors & Features

Detect and mitigate CVE-2026-54661 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 13.12.2

Fixed versions

  • 13.12.2

Solution

Upgrade to version 13.12.2 or above.

Impact 8.3 HIGH

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

Learn more about CVSS

Weakness

  • CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

npm/swagger-typescript-api/CVE-2026-54661.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:18:29 +0000.