Description
swagger-typescript-api generates API clients for Fetch or Axios from an OpenAPI Specification. Prior to 13.12.2, templates/base/http-clients/axios-http-client.ejs interpolates servers[0].url from src/code-gen-process.ts into the HttpClient constructor without escaping, allowing an attacker-controlled OpenAPI spec to inject code that executes when new HttpClient() or new Api() is constructed. This issue is fixed in version 13.12.2.
Published: 2026-07-29
Score: 8.3 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerable code is located in the axios-http-client.ejs template used by swagger‑typescript‑api to generate API clients. It injects the value of servers[0].url directly into the HttpClient constructor without escaping. An attacker who can supply a malicious OpenAPI specification can embed executable code in this URL field, causing that code to run whenever the generated client is instantiated. This leads to arbitrary code execution, a serious remote code execution vulnerability.

Affected Systems

The issue affects acacode’s Swagger TypeScript API, specifically the Axios HTTP client templates. All releases earlier than version 13.12.2 are vulnerable; the problem was fixed in v13.12.2 and later versions provide proper escaping of the URL field.

Risk and Exploitability

The CVSS base score of 8.3 indicates a high severity. The EPSS score is less than 1%, suggesting low current exploitation probability, and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector is the code‑generation phase, requiring an attacker to supply a crafted OpenAPI spec that the build process or developer uses to create a client. Once executed, the injected code runs with the privileges of the process creating the client. Though the exploitation surface is limited to environments that generate clients from untrusted specs, once triggered the impact is full local or remote code execution within that environment.

Generated by OpenCVE AI on August 3, 2026 at 13:18 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to swagger‑typescript‑api v13.12.2 or later to apply the official fix.
  • If an upgrade cannot be performed immediately, restrict the use of OpenAPI specifications to trusted sources and sanitize the servers[0].url field to escape special characters before code generation.
  • Audit any existing client code that was generated with earlier versions for hidden or injected code and re‑generate those clients with a safe configuration.

Generated by OpenCVE AI on August 3, 2026 at 13:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-38c3-wv3c-v3xj swagger-typescript-api vulnerable to code injection via unescaped `servers[0].url` in axios http-client template
History

Thu, 30 Jul 2026 14:30:00 +0000

Type Values Removed Values Added
First Time appeared Acacode
Acacode swagger-typescript-api
Vendors & Products Acacode
Acacode swagger-typescript-api

Wed, 29 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 29 Jul 2026 14:45:00 +0000

Type Values Removed Values Added
Description swagger-typescript-api generates API clients for Fetch or Axios from an OpenAPI Specification. Prior to 13.12.2, templates/base/http-clients/axios-http-client.ejs interpolates servers[0].url from src/code-gen-process.ts into the HttpClient constructor without escaping, allowing an attacker-controlled OpenAPI spec to inject code that executes when new HttpClient() or new Api() is constructed. This issue is fixed in version 13.12.2.
Title swagger-typescript-api vulnerable to code injection via unescaped `servers[0].url` in axios http-client template
Weaknesses CWE-1336
CWE-74
CWE-94
References
Metrics cvssV3_1

{'score': 8.3, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H'}


Subscriptions

Acacode Swagger-typescript-api
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-29T15:00:20.087Z

Reserved: 2026-06-15T20:16:46.199Z

Link: CVE-2026-54661

cve-icon Vulnrichment

Updated: 2026-07-29T14:56:45.472Z

cve-icon NVD

Status : Deferred

Published: 2026-07-29T15:16:25.440

Modified: 2026-07-30T19:23:14.707

Link: CVE-2026-54661

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T13:30:04Z

Weaknesses
  • 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')