Intel

AIKIDO-2026-11121

swagger-typescript-api is vulnerable to Code Injection

Code InjectionGHSA-5f94-x226-ccpm Published 3 days ago

83

High Risk

This Affects:

JSswagger-typescript-api
0.0.1 - 13.12.1
Fixed in 13.12.2
Are you affected? Scan for Free

TL;DR

swagger-typescript-api emits TypeScript enum declarations from OpenAPI specifications and wraps enum string values in double quotes without escaping them. A malicious spec can break out of the enum value string literal and inject a bare-block immediately-invoked function expression. Importing the generated module produced from an attacker-controlled spec executes the injected code at module load with the host process privileges, without any instantiation. The fix escapes enum string values before emitting them.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

swagger-typescript-api is vulnerable to Code Injection in versions 0.0.1 - 13.12.1.

How to fix this

Upgrade the swagger-typescript-api library to the patch version.