Vulnerability

openapi-typescript-codegen Code Injection (CVE-2026-108551)

A code injection flaw (CWE-94) in openapi-typescript-codegen, an npm tool that turns an OpenAPI document into a TypeScript client.

CVE ID
CVE-2026-108551
CVSS
9.8 Critical (CVSS 3.1) and 9.3 Critical (CVSS 4.0), both supplied by VulnCheck
Affected product
openapi-typescript-codegen (npm package, through 0.31.0)
Exploited
Unknown
Published
10 October 2026

In short

CVE-2026-108551 is a code injection flaw (CWE-94) in openapi-typescript-codegen, an npm tool that turns an OpenAPI document into a TypeScript client. In versions up to 0.31.0, a single quote in the document can run JavaScript when the generated client is loaded or called. No fixed release exists as of 25 October 2026.

Profile MapVulnerability
  1. CVECVE-2026-108551
  2. Productferdikoomen (open source project) openapi-typescript-codegen (npm package, through 0.31.0)
  3. Fix Steps5actions listedFind every use · Treat the spec as code

What it allows

openapi-typescript-codegen reads an OpenAPI document and writes a TypeScript client from it. VulnCheck's advisory says values from that document land inside single-quoted strings in the generated code with no escaping. A single quote in a path key, a parameter name, servers[0].url or info.version ends the string early. What follows runs as JavaScript when the generated client is imported or when a service method is called.

The researcher who reported it on the project's issue tracker (issue 2809, opened 4 September 2026) adds detail. The version and server URL fields run code as soon as the client's core/OpenAPI.ts file is loaded. The path and parameter-name fields run it on each call of the affected method.

The report also lists the request-body media type and the response header name. It says every HTTP client the tool can generate is affected: fetch, axios, xhr, node and angular. That list goes further than the CVE description.

Who Is at Risk

Our reading: the victim is whoever generates or loads the client, not a server reached over the internet. The issue names three places where the code can run. They are a developer's machine, a CI job that regenerates a client from a remote spec, and an app that loads a spec-driven client at run time.

Anyone who runs the tool on an OpenAPI document written or changed by someone else is exposed. Examples are a vendor's API spec, a partner's file, or a spec fetched from a URL during the build.

The flaw is in the tool's own templates, not in a tampered release, so this is not a poisoned release like the TanStack npm compromise (CVE-2026-45321). It still belongs to the development-tools part of the software supply chain, because the danger arrives through a file your build trusts. Our reading: a client generated earlier from a poisoned document keeps whatever was injected, so review committed generated files as well as the tool.

Scores and Status

VulnCheck assigned the CVE and rates it 9.8 on CVSS 3.1 and 9.3 on CVSS 4.0, both Critical. The vector is network, with no privileges or user interaction. NVD shows those scores and had not added its own analysis when we read it on 25 October (status Deferred).

Our reading: the network vector needs careful reading, because the attack only works when a poisoned OpenAPI document reaches the place where the client is generated or loaded. The issue reporter describes it the same way: the code runs where a client is built or run from an attacker-controlled or attacker-influenced spec.

A Project That Says It Is Unmaintained

The project README opens with a notice that it "has been unmaintained for a while now". It asks users to migrate to @hey-api/openapi-ts, which it says began as a fork.

The latest npm release is still 0.31.0, published 20 June 2026, the last version the CVE lists. Issue 2809 has no comments. npm counted 303,029 downloads of the package from 16 to 22 October 2026.

The CVE record names only openapi-typescript-codegen. The reporter says the same class of bug was reported and fixed earlier in other OpenAPI-to-TypeScript generators and names Orval and swagger-typescript-api. If you move to another tool, ask how it escapes values taken from the spec.

What GitHub, X and Telegram Show

GitHub: one public repository carries the CVE id. It was created on 23 October 2026 and describes itself as a "Defense guide + static scanner". Its README says it also holds a non-weaponized, educational demonstration that writes a harmless marker file.

The issue reporter says a proof of concept is available on request. We read the README as data, did not run anything and do not link the repository.

X: four public posts about the flaw appeared between 23 and 25 October. The widest came from a threat-news account with about 250,000 followers. On 24 October it posted on X that the repository holds a proof of concept and gave its link. The account's claim is its own, not ours.

Exploit signals
  • Public proof of concept (GitHub)YesOne repository created 23 October 2026 calls itself a defence guide and static scanner. Its README says it holds an educational demonstration that writes a harmless file. Read as data, not run, not linked23 Oct
  • Posts on XYesFour public posts about the flaw. The widest came from a threat-news account on 24 October23-25 Oct
  • Dark web (THANOS)UnknownThree posts, all in Telegram channels that share CVE feeds. Two on 10 October repeat the CVE record and one on 23 October lists the GitHub repository. These are feed posts, not verified10-23 Oct
  • Exploitation reported (CISA SSVC entry in NVD)Not seenThe CISA coordinator entry dated 13 October lists exploitation as none, automatable as yes and technical impact as total13 Oct
  • CISA KEVNot seenNot in the catalog release of 23 October 202623 Oct
Verdict Public demonstration exists, exploitation not reported

FIRST's EPSS model gave a probability of 0.4% (35th percentile) on 24 October.

Who is affected

The NVD record, supplied by VulnCheck, lists the npm package openapi-typescript-codegen from version 0 up to and including 0.31.0. The latest release on npm is 0.31.0, so every published release is in range.

No fixed version exists. The issue reporter confirmed the flaw on the main branch at commit d7c2a99 on 4 September 2026.

Is It Exploited Yet?

The CISA coordinator SSVC entry in the NVD record is dated 13 October 2026. It lists exploitation as none, automatable as yes and technical impact as total. The flaw was not in the CISA Known Exploited Vulnerabilities catalog in its 23 October 2026 release.

Timeline

  1. 4 Sep 2026

    A researcher opens issue 2809 on the project's tracker and says the flaw is confirmed on the main branch.

  2. 10 Oct 2026

    VulnCheck publishes its advisory, the CVE record appears in NVD and GitHub publishes advisory GHSA-3pr5-x7xf-mg4g, rated critical.

  3. 13 Oct 2026

    A CISA coordinator SSVC entry in the NVD record is dated this day: exploitation none, automatable yes, technical impact total.

  4. 23 Oct 2026

    A GitHub repository with a defence guide, a scanner and an educational demonstration is created. The CISA KEV release of this date does not list the flaw.

  5. 24 Oct 2026

    A threat-news account on X calls the repository a proof of concept and links it.

  6. 25 Oct 2026

    Issue 2809 is still open with no comments, and the latest npm release is still 0.31.0, published 20 June 2026.

What to do

  1. Find every use

    Search package.json files, lockfiles and CI scripts for openapi-typescript-codegen, including the openapi command it installs. A software bill of materials or a dependency scan can list the projects for you.

  2. Treat the spec as code

    Keep OpenAPI documents in version control, review changes to them and pin any outside spec by commit or hash. Do not fetch a spec from a URL during the build unless you control that source.

  3. Check the risky fields

    Before generating, reject any document with a single quote in a path key, a parameter name, servers[0].url, info.version, a media type or a response header name. The advisory and the issue name these fields.

  4. Isolate the build

    Run client generation in a short-lived CI job with no deploy keys, tokens or cloud credentials and with limited outbound network access. Review the generated files, including core/OpenAPI.ts, before they are committed or run.

  5. Plan the move

    No fixed release exists, and the project README tells users to migrate to @hey-api/openapi-ts. Before you switch, check how the new tool handles quotes in spec values, and watch issue 2809 in case a fix ships.

Questions

Which versions does CVE-2026-108551 affect?

The CVE record lists openapi-typescript-codegen up to and including 0.31.0. That is the latest release on npm, so every published release is in range.

Is there a fix for CVE-2026-108551?

No fixed release is listed. The latest npm release is 0.31.0, and issue 2809 was still open with no comments on 25 October 2026. The README tells users to migrate to @hey-api/openapi-ts.

Can someone attack my server with this flaw?

Not directly. Code runs where the generated client is built or loaded, such as a developer machine, a CI job or an app that loads a spec-driven client. The attacker needs the victim to use a poisoned OpenAPI document. The issue reporter says the code runs where a client is generated or run from an attacker-controlled or attacker-influenced spec.

Should I check a client I generated earlier?

Yes, if the OpenAPI document was not fully under your control. Review the generated files for code that does not belong, especially core/OpenAPI.ts. The issue says the version and server URL fields run as soon as that file is loaded.

Is CVE-2026-108551 exploited in the wild?

CISA's coordinator entry in the NVD record, dated 13 October 2026, lists exploitation as none. The flaw was not in the KEV catalog release of 23 October 2026. A public repository with a demonstration exists.

Is there public exploit code?

A GitHub repository created on 23 October 2026 describes itself as a defence guide and static scanner. Its README says it holds a non-weaponized demonstration that writes a harmless file. We have not run it.

In our research

  1. Software bill of materials (SBOM) Glossary term

Sources

  1. CVE-2026-108551 NVD
  2. openapi-typescript-codegen through 0.31.0 Code Injection via Handlebars Templates VulnCheck
  3. GHSA-3pr5-x7xf-mg4g GitHub Advisory Database
  4. Issue 2809: Code injection via unescaped spec-derived strings in generated clients openapi-typescript-codegen on GitHub
  5. openapi-typescript-codegen README openapi-typescript-codegen on GitHub
  6. openapi-typescript-codegen package data npm registry
  7. Known Exploited Vulnerabilities catalog CISA
  8. CWE-94: Improper Control of Generation of Code MITRE