{"id":"CVE-2026-54664","published":"2026-07-29T14:32:41Z","modified":"2026-07-30T15:19:53Z","title":"swagger-typescript-api vulnerable to code injection via unescaped enum string values","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, src/schema-parser/base-schema-parsers/enum.ts passes components.schemas.*.enum[i] values to Ts.StringValue in src/configuration.ts without escaping before templates/base/enum-data-contract.ejs renders TypeScript enum declarations, allowing an attacker-controlled OpenAPI spec to inject code that executes when the generated 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.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-5f94-x226-ccpm","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-30T13:39:16.270332Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"swagger-typescript-api","vulnerableRanges":["<13.12.2"],"patched":["13.12.2"],"from":["GHSA-5f94-x226-ccpm"],"provenance":"source"}],"summary":{"text":"swagger-typescript-api, the OpenAPI-to-client code generator, fails to escape enum string values taken from components.schemas in its enum schema parser before they are rendered into TypeScript enum declarations by its template, so the generated code can contain injected statements. An attacker who can supply a crafted OpenAPI specification to the generator, and who needs the victim to take the generation or user-interaction step, can get code to run when the generated module is imported; this flaw is fixed in 13.12.2 and earlier releases are affected.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:34:43Z"},"euvd":{"id":"EUVD-2026-50366","exploited":false,"provenance":"source"}}