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

CVE-2026-54666: swagger-typescript-api vulnerable to code injection via unescaped OpenAPI path strings in generated method bodies

July 29, 2026

swagger-typescript-api interpolates OpenAPI path strings (the keys of the paths object, e.g. /users/{id}) directly into a JavaScript template literal inside the body of every generated API method, without escaping. A spec path containing ${ … } survives parseRouteName’s {x} / :x rewriter verbatim and lands as live JS-template-literal interpolation inside the generated path: \…`` line. Any consumer who calls the affected generated method evaluates the attacker’s expression with full importer privileges — file read/write, exfiltration, etc. The attacker controls the OpenAPI spec (remote URL, third-party / public spec, multi-tenant platform); the victim is whoever runs the generator and uses the resulting client.

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-w284-33mx-6g9v
  • github.com/advisories/GHSA-w284-33mx-6g9v
  • nvd.nist.gov/vuln/detail/CVE-2026-54666

Code Behaviors & Features

Detect and mitigate CVE-2026-54666 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-54666.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 08 Aug 2026 00:19:07 +0000.