CVE-2026-54664
Received Received - Intake

TypeScript Enum Injection in swagger-typescript-api

Vulnerability report for CVE-2026-54664, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-29

Last updated on: 2026-07-29

Assigner: GitHub, Inc.

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-29
Last Modified
2026-07-29
Generated
2026-07-30
AI Q&A
2026-07-30
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
swagger_typescript_api swagger_typescript_api 13.12.2

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
CWE-74 The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
CWE-1336 The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability exists in swagger-typescript-api versions before 13.12.2. It allows an attacker to inject malicious code into TypeScript enum declarations by providing a specially crafted OpenAPI specification. The injected code executes when the generated module is imported.

Impact Analysis

If you use a vulnerable version of swagger-typescript-api and process an attacker-controlled OpenAPI spec, the generated code could execute arbitrary commands when imported. This could lead to data breaches, unauthorized access, or other malicious activities depending on the context of use.

Compliance Impact

This vulnerability could lead to unauthorized data access or exfiltration, violating GDPR's data protection requirements and HIPAA's security rules. Organizations using vulnerable versions may face compliance violations, legal penalties, and reputational damage.

Mitigation Strategies

Update swagger-typescript-api to version 13.12.2 or later to fix the vulnerability. Review any generated TypeScript enum declarations for suspicious content if you cannot immediately update.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-54664. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart