{"id":"CVE-2026-54661","published":"2026-07-29T14:30:29Z","modified":"2026-07-29T15:00:20Z","title":"swagger-typescript-api vulnerable to code injection via unescaped `servers[0].url` in axios http-client template","vendor":"acacode","product":"swagger-typescript-api","tier":"tail","description":{"text":"swagger-typescript-api generates API clients for Fetch or Axios from an OpenAPI Specification. Prior to 13.12.2, templates/base/http-clients/axios-http-client.ejs interpolates servers[0].url from src/code-gen-process.ts into the HttpClient constructor without escaping, allowing an attacker-controlled OpenAPI spec to inject code that executes when new HttpClient() or new Api() is constructed. 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.33582,"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-38c3-wv3c-v3xj","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":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-07-29T14:55:10.296257Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"swagger-typescript-api","vulnerableRanges":["<13.12.2"],"patched":["13.12.2"],"from":["GHSA-38c3-wv3c-v3xj"],"provenance":"source"}],"summary":{"text":"swagger-typescript-api, the tool that generates Fetch and Axios API clients from OpenAPI specifications, fails to escape the servers[0].url value when the Axios http-client template (axios-http-client.ejs) writes it into the HttpClient constructor. An attacker who can supply a malicious OpenAPI specification can get code injected into the generated client, which then runs when HttpClient or Api is constructed; exploitation requires that a victim generates code from the attacker's spec and a user interaction, while the attack itself is reachable over the network and needs no privileges.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:34:43Z"},"euvd":{"id":"EUVD-2026-50365","exploited":false,"provenance":"source"}}