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

- Severity: High 8.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.35%, higher than 30% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-07-29T14:26:15.992Z
- Modified: 2026-10-23T23:10:00.157Z
- Also known as: GHSA-hqj5-cw9f-rx67
- Weaknesses: CWE-74, CWE-94, CWE-1336
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- acacode swagger-typescript-api: < 13.12.2
- swagger-typescript-api (npm): before 13.12.2

## Every score

- GitHub_M: CVSS:3.1 8.3 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.3 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H`

## References

- <https://github.com/acacode/swagger-typescript-api/security/advisories/GHSA-hqj5-cw9f-rx67> (exploit, web)
- <https://github.com/acacode/swagger-typescript-api/pull/1779> (web)
- <https://github.com/acacode/swagger-typescript-api/commit/306d59acb8ffbb00f953f807b97234b21f51d9de> (web)
- <https://github.com/acacode/swagger-typescript-api/releases/tag/v13.12.2> (web)
- <https://github.com/acacode/swagger-typescript-api> (package)

## Sources

- CVE List: [CVE-2026-54662](https://www.cve.org/CVERecord?id=CVE-2026-54662), CVE Terms of Use, modified 2026-07-29
- GitHub Advisory Database: [GHSA-hqj5-cw9f-rx67](https://github.com/advisories/GHSA-hqj5-cw9f-rx67), CC-BY-4.0, modified 2026-08-13
- NVD: [CVE-2026-54662](https://nvd.nist.gov/vuln/detail/CVE-2026-54662), Public domain, modified 2026-10-23

---

Page: https://cve.day/CVE-2026-54662 · Whole record: https://cve.day/CVE-2026-54662.json · Rebuilt by cve.day 2026-11-25T22:59:30.440Z
