Skip to main content
← All vulnerabilities
CVE-2026-54662GHSA-HQJ5-CW9F-RX67

swagger-typescript-api vulnerable to code injection via unescaped `servers[0].url` in fetch http-client template

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 13.12.2
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: no
  • Technical impact: total

Summary

swagger-typescript-api generates API clients for Fetch or Axios from OpenAPI specifications. Prior to 13.12.2, src/code-gen-process.ts createApiConfig copies servers[0].url into apiConfig.baseUrl, and templates/base/http-clients/fetch-http-client.ejs interpolates apiConfig.baseUrl into the generated HttpClient baseUrl field without escaping, allowing an attacker-controlled OpenAPI spec to inject TypeScript static field code that executes when the generated fetch client module is imported. This issue is fixed in version 13.12.2.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: no · Technical impact: total

  3. Record last updated

Affected versions

  • acacode swagger-typescript-api

    fixed in 13.12.2

  • swagger-typescript-apinpm

    fixed in 13.12.2

References 4

GitHub · acacode/swagger-typescript-api