Skip to main content

openapi-python-client CVE-2026-105801

| EUVDEUVD-2026-93435 HIGH
Code Injection (CWE-94)
2026-10-06 GitHub_M GHSA-5293-mq8x-g3xj
8.4
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Craft malicious OpenAPI document
  2. Delivery
    Victim generates Python client (<0.29.1)
  3. Exploit
    Hostile code rendered into generated source
  4. Execution
    Developer or CI imports generated client
  5. Impact
    Arbitrary Python executes in importing environment

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 a victim run openapi-python-client prior to 0.29.1 to generate a client from an OpenAPI document whose string/docstring/f-string content is attacker-influenced (i.e., a spec the victim does not fully control, such as a third-party, public, or untrusted API definition), AND that the generated client subsequently be imported in a Python environment - importing is the trigger that executes the injected code. Limiting factors: active user/CI interaction is required (UI:P), the attack is local to the generation/import workflow rather than remotely reachable (AV:L), and organizations that only generate from trusted, internally-authored OpenAPI specs are effectively not exposed. Specifically unsafe areas were const/enum values, model/property descriptions rendered into docstrings, and values injected into f-string and double-quoted literals, which the fix now neutralizes via dedicated escaping helpers.

Impact

Signals are mixed and point to a serious but conditionally-triggered supply-chain/code-generation flaw rather than a mass-exploitable remote RCE. The vendor CVSS 4.0 score of 8.4 (High) is driven by VI:H plus full subsequent-system impact (SC:H/SI:H/SA:H), reflecting that attacker-controlled Python is injected into generated client code and runs with the privileges of whoever imports it. However, AV:L and UI:P (user must actually generate and then import the client from an attacker-influenced OpenAPI document) substantially reduce real-world reach compared with an unauthenticated network RCE - this is not wormable or drive-by. No EPSS score, no CISA KEV listing, and no public exploit were provided in the input, so there is no public exploit identified at time of analysis and no evidence of active exploitation. Note a tension in the impact metrics: the vendor set the vulnerable-system confidentiality VC:N while the advisory and description describe arbitrary code execution in the importing environment, which normally implies confidentiality impact too; the N appears conservative and defenders should treat successful exploitation as full compromise of the importing host. Net priority: genuinely high for any team that generates clients from OpenAPI documents they do not fully control (third-party/public specs), and low for teams that only process trusted, internally-authored specs.

Exploit ScenarioDerived

An attacker crafts a malicious OpenAPI document containing hostile content in string, docstring, or f-string fields; a developer or CI pipeline using openapi-python-client prior to 0.29.1 generates a Python client from that document, and the attacker-controlled Python is embedded in the generated source. The code executes the moment the generated client is imported, compromising the importing environment. No public proof-of-concept was provided in the input.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Oct 06, 2026

Openapi-python-client before 0.29.1 fails to neutralize attacker-influenced content from an OpenAPI document when rendering string, docstring, and f-string contexts, so a malicious or untrusted specification can cause arbitrary Python to be emitted into the generated client - code that then executes when that client is imported, compromising the integrity of the importing environment and potentially its confidentiality and availability. Exposure is conditional: it requires someone to generate a client from a spec they do not fully control (a third-party, public, or otherwise untrusted API definition) and then import the generated code, which is the trigger point, so organizations generating only from trusted internal specs are effectively unaffected. The flaw is rated 8.4 under CVSS 4.0 in the source data (independent assessment maps it to CVSS 3.1 AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H), which is consistent with a serious but conditionally triggered supply-chain and code-generation issue rather than a remotely reachable mass-exploitation vector. No public exploit code and no confirmed active exploitation were identified at time of analysis, and the vendor has shipped a fix in version 0.29.1.

RemediationAI

Upgrade openapi-python-client to 0.29.1 or later (Vendor-released patch: 0.29.1, commit 1c99af478892e5bbe6583b92acba431c9dec9186, PR 1483, advisory GHSA-5293-mq8x-g3xj) and then treat every previously generated client as suspect: regenerate all clients produced by pre-0.29.1 versions from their source specs and diff the output before redeploying, since injected code may already sit dormant in checked-in generated packages and only executes on import. Because the trigger is importing malicious generated code, a practical compensating control pending upgrade is to restrict generation to internally authored, trusted OpenAPI documents and to block CI jobs from fetching third-party specs; the trade-off is loss of convenience from auto-generating against public APIs. Additionally, review generated output for the UntrustedString sentinel, which indicates a value that was not routed through one of the new escaping helpers, and scan or manually inspect generated modules where legitimate spec content cannot be distinguished from injected code. Be aware that this release is deliberately breaking for all custom templates - the utils global was renamed to strings and direct rendering of raw values is no longer permitted, so templates must use safe_for_docstring, in_f_string_literal, in_double_quote_literal, or as_unembedded_code as appropriate; failing to port templates will break generation, and applying the new helpers incorrectly (for example using as_unembedded_code on a value destined for a docstring) reintroduces the risk. Note also that most Unicode control characters are now stripped from string literals, which may alter generated const values, enums, or JSON body property names for APIs that rely on them, though most APIs are unaffected. Finally, enable or run the project's fuzz workflow (pdm fuzz, controlled by OPENAPI_PYTHON_CLIENT_FUZZ_EXAMPLES) against local specs to catch escaping regressions in custom templates.

Affected VersionsENISA

openapi-python-client < 0.29.1

Affected Packages

pypi openapi-python-client fix: 0.29.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

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

Technical ContextAI · show details

The root cause is CWE-94 (Improper Control of Generation of Code, 'Code Injection') inside a code generator rather than in a running service. openapi-python-client consumes an OpenAPI document and emits Python source through Jinja-style templates, where values taken from the spec - model and property descriptions, const and enum values, JSON body property names - were previously interpolated into contexts such as triple-quoted docstrings, double-quoted string literals, and f-strings. Because those values were not escaped for the context into which they were rendered, content like a crafted """ terminator, a backslash escape, or an f-string expression brace could break out of the intended literal and become executable Python in the generated module. The fix is a context-aware escaping redesign: a new strings module replaces the old utils global, and values must now be described by how they will be used via dedicated helpers - strings.safe_for_docstring() for """ docstrings, strings.in_f_string_literal() for f"" literals, strings.in_double_quote_literal() for non-f-string "" literals, and as_unembedded_code() reserved strictly for PythonCode values that are intentionally code (for example .python_code, .get_type_string(), .get_instance_type_string(), .get_type_strings_in_union()). Any unescaped value surfaces as an UntrustedString sentinel in generated output, which makes residual escaping gaps observable. The same release strips most Unicode control characters from string literals and adds a fuzzing workflow (OPENAPI_PYTHON_CLIENT_FUZZ_EXAMPLES) to exercise generated Python, both defensive hardening measures tied to this class of bug. The CPE cpe:2.3:a:openapi-generators:openapi-python-client:*:*:*:*:*:*:*:* with no version bound matches every release before the fix.

Know when Python 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 (GitHub_M) PRIMARY 8.4 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:N/SC:H/SI:H/SA:H
vuln.today AI 8.6 HIGH

Attacker supplies a malicious document but the victim must generate and import the client (AV:L/UI:R/PR:N); injected code runs in a separate importing context (S:C) yielding full code execution (C/I/A:H).

3.1 AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Red Hat 7.8 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

2
Patch available
Oct 06, 2026 - 16:03 EUVD
CVE Published
Oct 06, 2026 - 14:53 cve.org
HIGH 8.4

DescriptionCVE.org

openapi-python-client generates Python clients from OpenAPI documents. Prior to 0.29.1, the generator does not safely neutralize malicious OpenAPI document content before rendering string, docstring, and f-string contexts in generated Python. The generated Python client can contain attacker-controlled Python that executes when a user imports the client, affecting the importing environment's integrity and potentially its confidentiality and availability. This issue is fixed in version 0.29.1.

Technical POC Analysis

Code injection into generated source: the generator emits Python identifiers, literals, docstrings, and f-strings derived from attacker-influenced OpenAPI document content without neutralizing the sp…

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

Openapi-python-client, a tool that generates Python clients from OpenAPI specifications, contains a high-severity vulnerability (CVE-2026-105801) that allows arbitrary Python code execution when a generated client is imported, but only if the client was generated from an untrusted or third-party specification. This creates a supply-chain risk for development environments and CI/CD pipelines where such generated code is executed, potentially compromising the integrity, confidentiality, and availability of affected systems. No public exploit identified at time of analysis; the flaw is unauthenticated (PR:N) and requires user interaction (UI:R), so organizations using this tool with external specs should prioritize mitigation.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include: only generate clients from fully trusted internal OpenAPI specifications; manually inspect all generated Python code before import; generate and run clients in isolated, least-privileged environments such as containers without network access or credentials; use static analysis or code scanning to detect unexpected code in generated files; and restrict execution of generated clients to authorized developers.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
Medium
popular Python OpenAPI client-generator, developer-tooling footprint, not everywhere
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

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 HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
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
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
Yes
Human Impact
High
Technical Impact
Total

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
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.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

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