CVE-2026-105801: openapi-python-client: Malicious OpenAPI Documents can cause Arbitrary Code Generation

Published Oct 6, 2026
·
Updated

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.

Other sources

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.

— MITRE

Affected Software

2 affected componentsFixes available
pypi/openapi-python-client<0.29.1
pip/openapi-python-client<0.29.1
0.29.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/openapi-python-client to a version that resolves this vulnerability.

    Fixed in 0.29.1
  2. Upgrade

    Upgrade openapi-python-client to a version that resolves this vulnerability.

    Fixed in 0.29.1
  3. Compensating control

    Do not generate clients from OpenAPI documents that are not completely trusted.

  4. Operational

    Carefully verify and audit any existing Python client code generated from untrusted OpenAPI documents before importing or using it.

Event History

Oct 6, 2026
CVE Published
via MITRE·02:53 PM
Data Sourced
via MITRE·02:53 PM
DescriptionWeakness
Data Sourced
via NVD·03:17 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·03:32 PM
Data Sourced
via GitHub·03:32 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which environments are exposed to this issue?

Environments using openapi-python-client versions before 0.29.1 are exposed if they generate a client from a malicious OpenAPI document and later import that generated client. The code executes in the environment that imports the client.

2

What must happen for exploitation to succeed?

A malicious OpenAPI document must be processed by the vulnerable generator. Its attacker-controlled content can be rendered into Python string, docstring, or f-string contexts, and execution occurs when the resulting client is imported.

3

What should be done if clients were previously generated from untrusted documents?

Upgrade openapi-python-client to version 0.29.1 or later immediately. Carefully audit generated code originating from untrusted documents before importing or using it.

4

What mitigation is available before upgrading?

Do not generate clients from OpenAPI documents unless they are completely trusted. Existing generated clients from untrusted sources should be carefully verified.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203