Skip to main content

openapi-typescript-codegen CVE-2026-108551

| EUVDEUVD-2026-96346 CRITICAL
Code Injection (CWE-94)
2026-10-10 VulnCheck GHSA-3pr5-x7xf-mg4g
9.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft OpenAPI document with single-quote payload
  2. Delivery
    Victim runs openapi-typescript-codegen against it
  3. Exploit
    Payload breaks out of single-quoted template literal
  4. Execution
    Generated client imported or service method called
  5. Impact
    Arbitrary JavaScript executes in consumer context

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the victim generate a TypeScript client with openapi-typescript-codegen (version <=0.31.0) from an OpenAPI document that is wholly or partly attacker-controlled, and then import the generated code or call a generated service method. The concrete injection points named in the description are path keys, parameter names, servers[0].url, and info.version - any of which, if containing an unescaped single quote plus JavaScript, breaks out of a single-quoted string literal in the Handlebars-generated output. Limiting factors: the attacker must be able to influence the OpenAPI spec consumed at generation time (e.g. third-party, public, or user-submitted specs), and a build/generation step followed by import or invocation must occur - purely trusted, first-party specs are not exposed. There is no runtime network-service exposure; this is a build-time/supply-chain code-execution condition against environments that generate clients from untrusted API definitions.

Impact

This is a CWE-94 code-injection flaw in openapi-typescript-codegen (through 0.31.0), a developer code-generation library, carrying a vendor/VulnCheck CVSS 4.0 base score of 9.3 (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H). The headline score treats this as a network, no-interaction, no-privilege critical, but that is misleading for real-world triage: exploitation is NOT a remote attack on a running service - it requires a developer (or build pipeline) to run the generator against an attacker-supplied OpenAPI document and then import/execute the generated client. That is a meaningful user-interaction/trust-boundary step the CVSS 4.0 UI:N does not capture, so I independently add UI:R (see assessed vectors below). On the exploitation signals: there is no CISA KEV listing, no EPSS probability supplied, and no public exploit code identified at time of analysis - so there is no evidence of active or at-scale exploitation; this is a disclosure-stage finding from VulnCheck with concrete source-line references to the vulnerable Handlebars templates. Net: genuinely high technical impact (arbitrary JavaScript execution) within a specific supply-chain/build-time threat model, but real-world risk is bounded by the need to process an untrusted spec. Treat as a priority for teams that generate clients from third-party or user-supplied OpenAPI documents, and as lower urgency for teams generating only from their own trusted specs. Note also the product is a deprecated project, so a maintained upstream fix may not be available - verify remediation path.

Exploit ScenarioDerived

An attacker publishes or supplies a crafted OpenAPI document containing a single quote plus JavaScript in a field such as a path key, parameter name, servers[0].url, or info.version. A victim developer or CI pipeline runs openapi-typescript-codegen (<=0.31.0) against that document, and the unescaped value breaks out of a single-quoted string literal in the generated TypeScript. The injected JavaScript then executes when the generated client is imported or a service method is called. No public exploit code was identified at time of analysis, though the VulnCheck advisory and CVE references point directly to the vulnerable template lines.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 10, 2026

Code injection in openapi-typescript-codegen through 0.31.0 allows attackers who control or influence an OpenAPI document to inject arbitrary JavaScript into generated TypeScript clients, which then executes when the client is imported or its service methods are called. Exploitation requires the victim to generate a client from an attacker-controlled spec (user interaction), and no public exploit code has been identified at time of analysis. The vendor/VulnCheck CVSS 4.0 base score is 9.3, though the independent assessment notes a CVSS 3.1 vector of AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H reflecting the required user interaction; it is not listed in CISA KEV.

RemediationAI

No vendor-released patch has been identified at time of analysis. To mitigate, avoid generating TypeScript clients from untrusted OpenAPI documents; if this is not possible, sanitize all string inputs before generation by escaping single quotes in path keys, parameter names, servers[0].url, and info.version, or fork the library and modify the Handlebars templates to use proper escaping (e.g., a helper function or triple-brace expressions). As a compensating control, run code generation in an isolated, sandboxed environment without access to secrets or production systems, and treat generated code as untrusted-review it before import. Monitor the GitHub repository and issue #2809 for an official fix; the VulnCheck advisory (https://www.vulncheck.com/advisories/openapi-typescript-codegen-through-0.31.0-code-injection-via-handlebars-templates) may be updated. Trade-offs: input sanitization may be complex and error-prone, forking incurs maintenance overhead, and sandboxing can hinder development workflows.

Affected VersionsENISA

openapi-typescript-codegen 0 ≤0.31.0

Affected Packages

euvd openapi_typescript_codegen no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

openapi-typescript-codegen is a Node.js library that generates TypeScript client code from OpenAPI specifications using Handlebars templates. The vulnerability arises because several template files, including exportService.hbs (lines 89-110) and OpenAPI.hbs (lines 20-23), interpolate attacker-controllable values directly into single-quoted string literals without proper escaping. This is a CWE-94 code injection flaw: a malicious OpenAPI document can include a single quote in path keys, parameter names, servers[0].url, or info.version, breaking out of the string context and allowing arbitrary JavaScript to be embedded in the generated client. The injected code executes when the generated client is imported or when service methods are called, giving attackers code execution in the context of the developer or build system that uses the generated code. The attack is build-time/supply-chain oriented and requires the victim to generate a client from an attacker-controlled spec; no runtime network service is exposed by the vulnerability itself. The CPE cpe:2.3:a:ferdikoomen:openapi-typescript-codegen:*:*:*:*:*:*:*:* identifies the affected package.

Know when Openapi Typescript Codegen gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 9.3 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 8.8 HIGH

Attacker needs no privileges and the spec can be delivered over the network (AV:N), but a developer/pipeline must run the generator and import the output, so UI:R; successful injection yields full code execution (C/I/A:H).

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

openapi-typescript-codegen through 0.31.0 contains a code injection vulnerability that allows attackers controlling an OpenAPI document to inject JavaScript by supplying unescaped values interpolated into single-quoted string literals. Attackers can embed a single quote in path keys, parameter names, servers[0].url, or info.version to execute arbitrary JavaScript when generated clients are imported or service methods called.

Executive ViewAI

Why It Matters

A critical code-injection flaw in openapi-typescript-codegen (all versions through 0.31.0) allows an attacker-controlled OpenAPI specification to plant arbitrary JavaScript inside the TypeScript client code the tool generates, which then executes on developer workstations or build infrastructure whenever that client is imported or its service methods are called. Because no vendor patch is currently available, any team that generates API clients from specifications it did not author - including partner, vendor, or community-sourced specs - carries unmitigated exposure. Leadership should care because the blast radius is not limited to one library: a compromised developer endpoint or CI runner can be leveraged to reach source repositories, credentials, and downstream production services.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis; no public exploit identified at time of analysis. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) indicates the issue is unauthenticated but requires the victim to generate a client from the malicious specification, so the strongest interim mitigations are process and isolation controls: treat all externally sourced OpenAPI documents as hostile and generate only from first-party, reviewed, hash-pinned specs; review and diff every generated client before it is imported or executed; perform generation in a sandboxed, network-restricted CI environment without production credentials or write access to source control; scan existing generated clients for injected or obfuscated JavaScript; limit and rotate credentials available to build agents; and migrate to a maintained fork or alternative generator until a vendor fix is released.

Threat Intelligence Overview

EPSS Score
0.4%
Top 66% exploitable
Prevalence
Medium
popular TypeScript OpenAPI client generator, but a dev-time tool, now deprecated
Social Media
4
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.4%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy