Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-105801 Overview
CVE-2026-105801 is a code injection vulnerability [CWE-94] in openapi-python-client, a tool that generates Python HTTP clients from OpenAPI specification documents. Versions prior to 0.29.1 fail to safely neutralize malicious content from OpenAPI documents before rendering it into string, docstring, and f-string contexts in generated Python source files. An attacker who controls or tampers with an OpenAPI document can embed Python code that executes the moment a developer imports the generated client. The vulnerability affects the integrity, confidentiality, and availability of the importing environment. Maintainers released version 0.29.1 to address the flaw.
Critical Impact
Attacker-controlled Python code executes on import of the generated client, enabling arbitrary code execution in developer and CI/CD environments.
Affected Products
- openapi-python-client versions prior to 0.29.1
- Python environments that import clients generated from untrusted OpenAPI documents
- CI/CD pipelines using openapi-python-client for automated client generation
Discovery Timeline
- 2026-10-06 - CVE-2026-105801 published to NVD
- 2026-10-06 - Last updated in NVD database
- v0.29.1 - Maintainers release patched version via GitHub Release v0.29.1
Technical Details for CVE-2026-105801
Vulnerability Analysis
The openapi-python-client project generates Python client libraries by rendering templates populated with values extracted from an OpenAPI document. The generator inserts fields such as descriptions, titles, enum values, and schema metadata directly into Python string literals, docstrings, and f-strings within the generated source files. Prior to version 0.29.1, this rendering did not escape or neutralize characters that would terminate the surrounding string context. An attacker who supplies a crafted OpenAPI document can break out of a string literal and append arbitrary Python statements. When a developer imports the generated client module, the Python interpreter evaluates the injected statements as part of normal module initialization.
Root Cause
The root cause is unsafe interpolation of untrusted OpenAPI document fields into Python source templates. The generator trusted that string content from the specification could be placed verbatim into literal, docstring, and f-string positions. Characters such as quotes, triple-quote sequences, and f-string expression delimiters were not escaped. This is a classic Improper Control of Generation of Code [CWE-94] weakness.
Attack Vector
Exploitation requires a victim to generate and import a Python client from an attacker-influenced OpenAPI document. The attack vector is local because the malicious code executes in the environment that imports the generated code. User interaction is required: a developer, pipeline, or build system must run openapi-python-client against the hostile specification and then import the result. Likely delivery channels include public API catalogs, supply-chain compromise of a schema registry, pull requests that modify committed OpenAPI files, or third-party API providers that return crafted specs.
The fix in version 0.29.1 is described as a comprehensive string handling rewrite. Repository changes accompanying the patch (.gitignore and knope.toml updates) are visible in the published commit:
htmlcov/
# Generated end to end test data
-my-test-api-client/
-custom-e2e/
-3-1-features-client
-tests/tmp
+tests/tmp
+end_to_end_tests/tmp/*
Source: GitHub Commit 1c99af4
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-105801
Indicators of Compromise
- Generated client files containing unexpected import statements, exec(), eval(), os.system(), or subprocess calls in module scope.
- Docstrings or string literals in generated code that contain quote characters, triple quotes, or f-string braces originating from OpenAPI field values.
- Outbound network connections from Python processes immediately following import of a generated client.
- Build or CI jobs that spawn child processes outside the normal openapi-python-client command set.
Detection Strategies
- Perform static review or ast.parse() scanning of generated client modules to flag calls to exec, eval, compile, __import__, or subprocess in module top-level code.
- Diff generated client output against a baseline produced from a trusted copy of the specification to surface injected statements.
- Audit the OpenAPI documents consumed by builds for suspicious characters in description, title, summary, and enum fields.
Monitoring Recommendations
- Monitor developer workstations and build agents for unexpected process creation chains originating from python interpreters during package import.
- Alert on openapi-python-client invocations against specifications sourced from external URLs or untrusted repositories.
- Capture and retain the raw OpenAPI documents used by each build for post-incident forensic review.
How to Mitigate CVE-2026-105801
Immediate Actions Required
- Upgrade openapi-python-client to version 0.29.1 or later across all developer, CI, and build environments.
- Regenerate every client previously produced from third-party or untrusted OpenAPI documents using the patched version.
- Review generated client source files for injected Python before re-importing them in production code.
- Treat OpenAPI documents from external sources as untrusted input and validate their contents prior to code generation.
Patch Information
The vulnerability is fixed in openapi-python-client version 0.29.1. The upstream fix is a comprehensive rewrite of string handling in the code generator. See the GitHub Security Advisory GHSA-5293-mq8x-g3xj, Pull Request #1483, and the patch commit 1c99af4 for implementation details.
Workarounds
- Pin openapi-python-client to >=0.29.1 in pyproject.toml or requirements.txt to prevent accidental downgrade.
- Restrict client generation to OpenAPI documents from vetted, internally controlled sources until all consumers are upgraded.
- Run openapi-python-client inside an isolated, non-privileged sandbox so that any injected code cannot access developer credentials or production secrets.
- Add pre-import static analysis to CI that rejects generated modules containing executable statements at module scope.
# Upgrade to the patched release
pip install --upgrade 'openapi-python-client>=0.29.1'
# Verify installed version
openapi-python-client --version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

