{"id":"CVE-2026-54662","published":"2026-07-29T14:26:15Z","modified":"2026-07-29T15:16:06Z","title":"swagger-typescript-api vulnerable to code injection via unescaped `servers[0].url` in fetch http-client template","vendor":"acacode","product":"swagger-typescript-api","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.3,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00477,"percentile":0.33583,"provenance":"source"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"},{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine"}],"references":[{"url":"https://github.com/acacode/swagger-typescript-api/security/advisories/GHSA-hqj5-cw9f-rx67","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/acacode/swagger-typescript-api/pull/1779","tags":["x_refsource_MISC"]},{"url":"https://github.com/acacode/swagger-typescript-api/commit/306d59acb8ffbb00f953f807b97234b21f51d9de","tags":["x_refsource_MISC"]},{"url":"https://github.com/acacode/swagger-typescript-api/releases/tag/v13.12.2","tags":["x_refsource_MISC"]}],"priority":{"score":12.5,"factors":[{"name":"EPSS percentile","points":6.72},{"name":"CVSS severity","points":5.81}]},"vendorSlug":"acacode","affectedVersions":[{"vendor":"acacode","product":"swagger-typescript-api","versions":["< 13.12.2"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2026-07-29T15:15:30.473520Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"swagger-typescript-api","vulnerableRanges":["<13.12.2"],"patched":["13.12.2"],"from":["GHSA-hqj5-cw9f-rx67"],"provenance":"source"}],"summary":{"text":"swagger-typescript-api, prior to version 13.12.2, fails to escape the servers[0].url value from an OpenAPI specification when it is written into the generated fetch HTTP client template, so the baseUrl field is built from unsanitised input. An attacker who can supply a malicious OpenAPI specification that the generator processes, and who gets a user to import the resulting generated fetch client module, can inject TypeScript code that runs on import; the attack requires user interaction and an attacker-controlled specification.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:51:44Z"},"euvd":{"id":"EUVD-2026-50363","exploited":false,"provenance":"source"}}