CVE-2026-54664: swagger-typescript-api vulnerable to code injection via unescaped enum string values
swagger-typescript-api interpolates components.schemas.*.enum[i] string values into the body of generated TypeScript enum declarations without escaping. A malicious enum value can close the enclosing string literal, terminate the enum body, and inject a bare-block IIFE that executes at module load the first time the generated client is imported. The trigger requires no instantiation and no method call — only an import of the generated module. The attacker controls the OpenAPI spec (remote --url, third-party / public spec, multi-tenant platform); the victim is whoever runs the generator and imports the result (the developer, their CI runner, or any downstream consumer of the generated package). Impact is arbitrary code execution with the importing process’s privileges — read any file the importer can read, write any file, exfiltrate secrets, etc.
References
- github.com/acacode/swagger-typescript-api/commit/306d59acb8ffbb00f953f807b97234b21f51d9de
- github.com/acacode/swagger-typescript-api/pull/1779
- github.com/acacode/swagger-typescript-api/releases/tag/v13.12.2
- github.com/acacode/swagger-typescript-api/security/advisories/GHSA-5f94-x226-ccpm
- github.com/advisories/GHSA-5f94-x226-ccpm
- nvd.nist.gov/vuln/detail/CVE-2026-54664
Code Behaviors & Features
Detect and mitigate CVE-2026-54664 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →