Description
swagger-typescript-api generates API clients for Fetch or Axios from an OpenAPI Specification. Prior to 13.12.2, src/schema-routes/schema-routes.ts passes OpenAPI path keys through parseRouteName to templates/default/procedure-call.ejs and templates/modular/procedure-call.ejs without escaping JavaScript template literal interpolation, allowing an attacker-controlled path containing ${...} to execute when the generated method is called. 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

swagger-typescript-api generates API clients from an OpenAPI Specification. The code generator did not escape JavaScript template literal placeholders when incorporating OpenAPI path strings into generated method bodies. An attacker who controls or injects a path containing a ${…} expression can cause that code to be evaluated during method execution, allowing arbitrary JavaScript execution.

Affected Systems

The vendor is acacode, product swagger-typescript-api. Versions up to and including 13.12.1 are affected. The vulnerability is fixed in release 13.12.2 and later.

Risk and Exploitability

The CVSS score of 8.3 classifies the flaw as high severity. The EPSS score of less than 1% indicates a very low exploitation probability at the time of analysis, and the vulnerability is not listed in CISA KEV. Exploitation requires an attacker to supply a malicious OpenAPI specification to the code generator, so it typically operates in the development or build environment. The injected code executes within the context of the generated client when its methods are called, which can lead to remote code execution on the developer's machine or in a browser environment that consumes the client.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade swagger-typescript-api to version 13.12.2 or newer.
  • Ensure that any OpenAPI specification used with the generator is validated and sanitized, removing or escaping ${…} patterns before generation.
  • Audit generated client code for embedded template literal interpolation and correct any remaining unescaped path strings before deployment.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-w284-33mx-6g9v swagger-typescript-api vulnerable to code injection via unescaped OpenAPI path strings in generated method bodies
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
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', '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, src/schema-routes/schema-routes.ts passes OpenAPI path keys through parseRouteName to templates/default/procedure-call.ejs and templates/modular/procedure-call.ejs without escaping JavaScript template literal interpolation, allowing an attacker-controlled path containing ${...} to execute when the generated method is called. This issue is fixed in version 13.12.2.
Title swagger-typescript-api vulnerable to code injection via unescaped OpenAPI path strings in generated method bodies
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-30T13:47:57.135Z

Reserved: 2026-06-15T22:53:58.560Z

Link: CVE-2026-54666

cve-icon Vulnrichment

Updated: 2026-07-30T13:47:27.703Z

cve-icon NVD

Status : Deferred

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

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

Link: CVE-2026-54666

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