CVE-2026-105801: CWE-94: Improper Control of Generation of Code ('Code Injection') in openapi-generators openapi-python-client
Description
### Impact A malicious OpenAPI document processed by any `openapi-python-client` prior to 0.29.1 can generate arbitrary Python code. When anyone imports the malicious client, that arbitrary Python code will execute. ### Patches Versions starting with 0.29.1 have updated with guardrails to prevent arbitrary code generation. Upgrade to this version immediately and audit any code previously generated from untrusted documents. ### Workarounds Do not generate clients for documents you don't completely trust. Carefully verify any existing generated code from untrusted documents.
CVSS v4.0
Score 8.4high
Affected software
openapi-generators
openapi-python-client
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
openapi-python-client versions before 0.29.1 improperly control the generation of code by failing to safely neutralize malicious OpenAPI document content before rendering it into string, docstring, and f-string contexts in generated Python clients. This leads to code injection (CWE-94), where attacker-controlled Python code can be embedded and executed upon importing the generated client. This vulnerability affects the importing environment's integrity, confidentiality, and availability. The vulnerability is addressed in version 0.29.1.
Potential Impact
An attacker who can supply a malicious OpenAPI document can cause the generation of a Python client containing arbitrary Python code. This code executes when the client is imported, potentially compromising the importing environment's integrity, confidentiality, and availability. This could lead to unauthorized code execution and system compromise in environments that use the affected versions of openapi-python-client.
Mitigation Recommendations
Upgrade openapi-python-client to version 0.29.1 or later, where this code injection vulnerability is fixed. Avoid using generated clients from untrusted OpenAPI documents until the upgrade is applied.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-05T20:37:19.364Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ac50de12cdf04f656bca329
Added to database: 10/06/2026, 15:04:01 UTC
Last enriched: 10/06/2026, 15:18:22 UTC
Last updated: 10/06/2026, 18:57:28 UTC
Views: 12
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.