Intel

AIKIDO-2026-11120

swagger-typescript-api is vulnerable to Code Injection

Code InjectionGHSA-38c3-wv3c-v3xj 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 axios HTTP client constructor without escaping it. A malicious specification can use computed-property-key injection to break out of the baseURL assignment and run arbitrary JavaScript when consumers instantiate the generated HttpClient or Api class. The injected code executes with the host process privileges. 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.