CVE-2026-105801

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

Published Oct 6, 2026 CVSS 4.0 · 8.4 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The vulnerability lies in the code generation logic of the openapi-python-client. When processing an OpenAPI document, the generator does not neutralize malicious content before embedding it into Python source code, including string literals, docstrings, and f-strings. An attacker can embed arbitrary Python code in the specification; once the client library is imported, that code runs within the importing process, compromising the integrity of the environment and potentially leaking data or interrupting operations.

Affected Systems

Affected users are those employing the openapi-generators openapi-python-client tool to generate client libraries. Any generation that preceded version 0.29.1 is vulnerable; the fix was introduced in release v0.29.1. No specific older sub‑versions are listed, so all prior releases are considered affected.

Risk and Exploitability

With a CVSS score of 8.4 this vulnerability is considered high severity. No EPSS score is available and the issue is not cataloged in the CISA KEV list, so publicly known exploitation activity is not confirmed. The attack requires an attacker to supply a crafted OpenAPI document and a victim to generate (or import) the resulting client library; the code is executed in the context of the importing process. Thus, the most likely attack vector is local code execution via a trusted generation workflow or import process that processes untrusted specifications.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade openapi-python-client to v0.29.1 or later.
  • If upgrading is not immediately possible, run the generator in a secure, isolated environment and restrict the input OpenAPI documents to trusted sources, stripping or validating any content that could be injected into code string contexts.
  • After generation, review the client source for unexpected code before integrating it into a production system.

Generated by OpenCVE AI on October 6, 2026 at 18:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-5293-mq8x-g3xj openapi-python-client: Malicious OpenAPI Documents can cause Arbitrary Code Generation
History
Type Values Removed Values Added
First Time appeared Openapi-generators
Openapi-generators openapi-python-client
Vendors & Products Openapi-generators
Openapi-generators openapi-python-client
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title openapi-python-client: Malicious OpenAPI Documents can cause Arbitrary Code Generation
Weaknesses CWE-116
CWE-150
CWE-94
References
Metrics cvssV4_0

{'score': 8.4, 'vector': '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'}

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-150

    Improper Neutralization of Escape, Meta, or Control Sequences

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 9, 2026, 1:06 AM
Reserved
Oct 5, 2026, 8:37 PM
Status
Deferred
Published
Oct 6, 2026, 3:17 PM
Modified
Oct 9, 2026, 2:16 AM