Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 1.0%top 40%

CVE-2026-59862: CWE-94: Improper Control of Generation of Code ('Code Injection') in microsoft kiota

0
High
VulnerabilityCVE-2026-59862cvecve-2026-59862cwe-94
Published: 07/16/2026 (07/16/2026, 14:38:59 UTC)
Source: CVE Database V5
Vendor/Project: microsoft
Product: kiota

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.

CVSS v3.1

Score 7.5high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected software

kiota
pkg:pypi/kiota
Affected versions
<1.32.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/31/2026, 12:29:52 UTC

Technical Analysis

Microsoft Kiota is an OpenAPI-based HTTP client code generator. In versions before 1.32.0, the Python generator component improperly handled attacker-controlled enum value descriptions from the x-ms-enum.values[].description field. These descriptions flowed through KiotaBuilder.SetEnumOptions into Documentation.DescriptionTemplate and PythonConventionService.RemoveInvalidDescriptionCharacters without sanitizing newline characters. This flaw enabled generated inline comments to be split, allowing arbitrary Python code injection and execution at module scope when the generated modules were imported. The vulnerability is identified as CWE-94 (Improper Control of Generation of Code). The issue is resolved in Kiota version 1.32.0.

Potential Impact

An attacker can inject and execute arbitrary Python code in the context of the generated module by supplying malicious enum value descriptions. This can lead to arbitrary code execution at module import time, potentially compromising the environment where the generated code is used. The CVSS v3.1 base score is 7.5 (High), reflecting network attack vector, low attack complexity, no privileges required, no user interaction, and an impact on availability but no direct confidentiality or integrity impact.

Mitigation Recommendations

This vulnerability is fixed in Kiota version 1.32.0. Users should upgrade to version 1.32.0 or later to remediate this issue. No other official remediation or temporary fixes are indicated. Patch status is confirmed by the vendor advisory stating the fix is included in version 1.32.0.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-07-07T15:41:53.606Z
Cvss Version
3.1
State
PUBLISHED
Remediation Level
null

Threat ID: 6a58ef3568715ace43306155

Added to database: 07/16/2026, 14:48:21 UTC

Last enriched: 07/31/2026, 12:29:52 UTC

Last updated: 08/16/2026, 00:41:14 UTC

Views: 83

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses