Description
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.0, Kiota's Python generator let attacker-controlled enum value descriptions from x-ms-enum.values[].description flow through KiotaBuilder.SetEnumOptions into Documentation.DescriptionTemplate and PythonConventionService.RemoveInvalidDescriptionCharacters without newline sanitization, allowing generated inline comments to split and execute attacker-controlled Python code at module scope when generated modules were imported. This issue is fixed in version 1.29.1 and 1.32.0.
Published: 2026-07-16
Score: 7.5 High
EPSS: 1.4% Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Kiota is an OpenAPI‑based HTTP client code generator. In versions before 1.29.1 and 1.32.0 the Python generator allowed attacker‑controlled enum value descriptions (x‑ms‑enum.values[].description) to flow unchecked into the documentation template and comment rendering logic. Because newline characters were not sanitized, malicious input could break out of comments and be interpreted as executable Python code when the generated module was imported, giving the attacker the ability to run arbitrary code on the system that imports the generated client.

Affected Systems

Microsoft Kiota Python generator versions earlier than 1.32.0 are impacted. The fix is included in releases 1.29.1 and 1.32.0 and later.

Risk and Exploitability

The CVSS score of 7.5 denotes high severity. The exploit requires control of the OpenAPI specification supplied to the generator, so the attack vector is limited to the environment where code generation occurs. Based on the description, it is inferred that the attack can only be carried out locally during the build or generation process. The EPSS score of 1 % indicates a low but nonzero probability of exploitation, and the vulnerability is not listed in the CISA KEV catalog, suggesting no known public exploitation. Nevertheless, if an untrusted OpenAPI definition is processed, arbitrary code could be executed on the host running Kiota.

Generated by OpenCVE AI on August 17, 2026 at 20:55 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Microsoft Kiota to version 1.32.0 or later, where the injection flaw is fixed.
  • Run the Kiota code generator in a tightly controlled, low‑privilege environment, such as a dedicated CI container, so that any executed code is isolated from critical systems.
  • If an immediate update is not possible, manually sanitize or remove newline characters from x‑ms‑enum.values[].description before generating code, or apply an upstream patch to the generator that enforces newline stripping.

Generated by OpenCVE AI on August 17, 2026 at 20:55 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-7f3j-j7jj-r3vr Microsoft Kiota: Code Generation Literal Injection in Kiota Python Generator
History

Mon, 17 Aug 2026 15:15:00 +0000

Type Values Removed Values Added
Description Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.32.0, Kiota's Python generator let attacker-controlled enum value descriptions from x-ms-enum.values[].description flow through KiotaBuilder.SetEnumOptions into Documentation.DescriptionTemplate and PythonConventionService.RemoveInvalidDescriptionCharacters without newline sanitization, allowing generated inline comments to split and execute attacker-controlled Python code at module scope when generated modules were imported. This issue is fixed in version 1.32.0. Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.0, Kiota's Python generator let attacker-controlled enum value descriptions from x-ms-enum.values[].description flow through KiotaBuilder.SetEnumOptions into Documentation.DescriptionTemplate and PythonConventionService.RemoveInvalidDescriptionCharacters without newline sanitization, allowing generated inline comments to split and execute attacker-controlled Python code at module scope when generated modules were imported. This issue is fixed in version 1.29.1 and 1.32.0.

Wed, 29 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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

ssvc

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


Thu, 16 Jul 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Thu, 16 Jul 2026 15:45:00 +0000

Type Values Removed Values Added
First Time appeared Microsoft
Microsoft kiota
Vendors & Products Microsoft
Microsoft kiota

Thu, 16 Jul 2026 14:45:00 +0000

Type Values Removed Values Added
Description Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.32.0, Kiota's Python generator let attacker-controlled enum value descriptions from x-ms-enum.values[].description flow through KiotaBuilder.SetEnumOptions into Documentation.DescriptionTemplate and PythonConventionService.RemoveInvalidDescriptionCharacters without newline sanitization, allowing generated inline comments to split and execute attacker-controlled Python code at module scope when generated modules were imported. This issue is fixed in version 1.32.0.
Title Kiota: Code Generation Literal Injection in the Python Generator
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-17T15:02:15.729Z

Reserved: 2026-07-07T15:41:53.606Z

Link: CVE-2026-59862

cve-icon Vulnrichment

Updated: 2026-07-16T18:10:57.554Z

cve-icon NVD

Status : Deferred

Published: 2026-07-16T15:16:35.570

Modified: 2026-08-17T15:16:56.623

Link: CVE-2026-59862

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-17T21:00:14Z

Weaknesses
  • CWE-94

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