8.4high
openapi-python-client: Malicious OpenAPI Documents can cause Arbitrary Code Generation
- Severity
- 8.4high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.14% (higher than 3% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-5293-mq8x-g3xjPYSEC-2026-4245
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| openapi-generators openapi-python-client | < 0.29.1 | CVE List |
| openapi-python-client (PyPI) | before 0.29.1 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 8.4high CVSS:4.0 | 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 |
| GitHub | high CVSS:4.0 | 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 |
| PyPA Advisory Database | Not scored CVSS:4.0 | 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 |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-105801 changed 2026-10-09 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5293-mq8x-g3xj changed 2026-10-15 | CC-BY-4.0 |
| NVD | CVE-2026-105801 changed 2026-10-09 | Public domain |
| PyPA Advisory Database | PYSEC-2026-4245 changed 2026-10-15 | CC-BY-4.0 |