Intel

AIKIDO-2026-11119

swagger-typescript-api is vulnerable to Code Injection

Code InjectionGHSA-hqj5-cw9f-rx67 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 interpolates the OpenAPI servers[0].url value raw into the string literal of its generated fetch HTTP client template without escaping it. A malicious specification can break out of the string literal and inject TypeScript that runs as a static class field initializer. Simply importing the generated module produced from an attacker-controlled spec executes the injected code with the host process privileges, without any instantiation or method call. The fix escapes the base URL once at the source before template rendering.

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.