CVE-2026-54666 swagger-typescript-api vulnerable to code injection via unescaped OpenAPI path strings in generated method bodies

High 8.3 Published Updated

Attackers can execute arbitrary code by providing malicious OpenAPI paths that inject JavaScript into generated client methods.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-54666?

CVE-2026-54666 is a high-severity code injection vulnerability in acacode swagger-typescript-api, published on 29 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

swagger-typescript-api generates API clients for Fetch or Axios from an OpenAPI Specification. Prior to 13.12.2, src/schema-routes/schema-routes.ts passes OpenAPI path keys through parseRouteName to templates/default/procedure-call.ejs and templates/modular/procedure-call.ejs without escaping JavaScript template literal interpolation, allowing an attacker-controlled path containing ${...} to execute when the generated method is called. This issue is fixed in version 13.12.2.

Weakness: CWE-94, CWE-74, CWE-1336

Which versions are affected by CVE-2026-54666?

2 open source packages ship an affected version, including swagger-typescript-api.

PackageAffectedFixed in
swagger-typescript-api npmAll versions13.12.2
swagger-typescript-api npmAll versions13.12.2

How do I fix CVE-2026-54666?

Upgrade swagger-typescript-api to 13.12.2 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-54666 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54666 exists.

Sources

Also known as GHSA-w284-33mx-6g9v.

Is CVE-2026-54666 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free