CVE-2026-59862 Details
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.
A code generation literal injection vulnerability has been identified in the Microsoft Kiota Python HTTP client code generator, prior to version 1.32.0. This vulnerability allows attacker-controlled enum value descriptions from OpenAPI specifications to be injected into generated Python code without proper newline sanitization. As a result, when the generated modules are imported, the injected content can escape comment contexts and execute arbitrary Python code at the module scope. This issue arises from two main gaps: the first allows malicious descriptions to propagate without cleanup, and the second fails to sanitize newline characters in Python-specific description handling. The vulnerability is exploited by generating a client from a malicious OpenAPI specification and importing the resulting code, a common practice in development and continuous integration workflows.
Users are advised to upgrade to Kiota version 1.32.0 or later and regenerate any existing Python clients to replace the vulnerable output. After upgrading, clients should be regenerated from the same OpenAPI specification used during proof-of-concept testing to ensure that the vulnerability has been addressed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jul 16, 2026CISA-ADP
Assessed Jul 17, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/microsoft/kiota/releases/tag/v1.32.0 | [email protected] | Release NotesVendor |
| https://github.com/microsoft/kiota/security/advisories/GHSA-7f3j-j7jj-r3vr | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Microsoft Kiota | < 1.32.0 (semver) |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 17, 2026 | CVE Modified | [email protected] |
| Jul 29, 2026 | CVE Modified | CISA-ADP |
| Jul 17, 2026 | CVE Modified | CISA-ADP |
| Jul 16, 2026 | CVE Modified | CISA-ADP |
| Jul 16, 2026 | New CVE Received | [email protected] |
Volerion