openapi-python-client: Arbitrary Python code generation from malicious OpenAPI documents
Summary
openapi-python-client generates Python API clients from OpenAPI documents. Before version 0.29.1, the generator does not properly neutralise malicious content from an OpenAPI document when it renders strings, docstrings and f-strings. An attacker who supplies a crafted document can cause the generated client to contain Python code that runs when a user imports the client, which can compromise the integrity of the importing environment and potentially its confidentiality and availability. The risk applies mainly to build pipelines and developer workstations that generate clients from OpenAPI documents they do not control.
Affected
- openapi-python-client versions before 0.29.1
- Vendor and CVE record: affected < 0.29.1
Fixed in
- Fixed in openapi-python-client 0.29.1
- 0.29.1 requires Python 3.11 or later
- The release changes the string-escaping helpers, so custom templates must be updated
Workaround
- Do not generate clients from OpenAPI documents you do not fully trust
- Carefully review existing clients generated from untrusted documents before importing them
- Unknown: no other workaround has been published by the vendor
Exploitation
- CISA SSVC: exploitation none, automatable yes, technical impact total
- No reports of active exploitation found; no CISA KEV entry found in our searches
- No public proof of concept found
- Authentication is not required to supply a malicious document, but a person must import the generated client
Our recommendation
- Inventory all uses of openapi-python-client, including development dependencies and CI pins, and identify versions below 0.29.1
- Upgrade to 0.29.1 where Python 3.11 or later is available, and update custom templates
- Regenerate clients only from trusted OpenAPI documents
- Review previously generated code from untrusted documents for unexpected executable content before importing it
- Do not treat a clean dependency scan as proof that the software is not affected
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GitHub Security Advisory GHSA-5293-mq8x-g3xj github.com
- Release v0.29.1 github.com
- Fix commit 1c99af4 github.com
- Pull Request #1483 github.com
- OSV: CVE-2026-105801 osv.dev
- OSV: GHSA-5293-mq8x-g3xj osv.dev
- GitLab Advisory Database: CVE-2026-105801 advisories.gitlab.com
- PyPI: openapi-python-client pypi.org
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 12:48.
Original description (NVD)
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.
NVD references (4)
- https://github.com/openapi-generators/openapi-python-client/commit/1c99af478892e5bbe6583b92acba431c9dec9186
- https://github.com/openapi-generators/openapi-python-client/pull/1483
- https://github.com/openapi-generators/openapi-python-client/releases/tag/v0.29.1
- https://github.com/openapi-generators/openapi-python-client/security/advisories/GHSA-5293-mq8x-g3xj
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
