Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious OpenAPI spec with newline in x-ms-enum description
-
DeliveryDeliver spec to victim developer or CI
-
ExploitVictim runs Kiota Python generator (<1.32.0)
-
ExecutionPayload emitted as module-scope Python code
-
PersistVictim imports generated module
-
ImpactArbitrary code executes in build/dev context
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the attacker to control or influence the OpenAPI description consumed by Kiota - specifically the x-ms-enum vendor-extension values[].description field - and to embed newline characters that break out of the generated Python comment. Kiota must be a version prior to 1.32.0 and must be run in Python generation mode. The payload only executes when the victim subsequently imports or runs the generated module, so a developer/CI action (generate then import) is the required user interaction and the primary limiting factor. It is NOT remotely exploitable against a running service; it targets the build/code-generation stage. Limiting factors: victim must trust and process an attacker-influenced spec, must use the Python (or Ruby) generator, and must import the output - first-party-only, reviewed specs effectively neutralize the attack. |
| Impact | The signals are mixed and require judgment. The supplied CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, score 7.5) models availability-only impact with no user interaction, which is internally inconsistent for a code-injection flaw: arbitrary Python at module scope grants full confidentiality and integrity impact, not just availability, so the true impact metrics should be C:H/I:H/A:H. Conversely, the vector overstates reachability by marking UI:N - realistic exploitation requires a developer to run the generator against the malicious spec and import the output, which is user interaction. No EPSS score was provided, there is no KEV listing, and no public POC is referenced, so this is not evidence of active or imminent mass exploitation. The realistic risk is a targeted developer-supply-chain / build-time attack rather than a remotely sprayable internet exploit: high technical impact if triggered, but gated on trusting an attacker-influenced OpenAPI document. Treat as a meaningful priority for teams that generate Kiota Python clients from third-party or untrusted OpenAPI descriptions, and lower priority where specs are fully first-party and reviewed. |
| Exploit ScenarioDerived | An attacker publishes or supplies an OpenAPI description whose x-ms-enum enum value description contains a newline followed by malicious Python (e.g., os.system(...) or an exfiltration snippet). A developer points Kiota (pre-1.32.0) at that spec to generate a Python client; the payload is written as top-level code in a generated module and executes the moment the developer or CI imports the module. No public exploit code is currently identified, but the technique is straightforward given the described sink. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 16, 2026
Code injection in Microsoft Kiota's Python client generator (versions prior to 1.32.0) allows an attacker who controls an OpenAPI description to embed arbitrary Python that executes when a developer generates and imports the resulting client. The flaw stems from unsanitized x-ms-enum.values[].description strings being emitted as inline comments; embedded newlines break out of the comment and run at module scope. No public exploit identified at time of analysis, and the issue is not in CISA KEV. The assigned CVSS 3.1 base score is 7.5, though its impact metrics (C:N/I:N/A:H) understate what is functionally full code execution.
RemediationAI
Vendor-released patch: 1.32.0 - upgrade Kiota to 1.32.0 or later before generating any further Python (or Ruby) clients, per advisory GHSA-7f3j-j7jj-r3vr (https://github.com/microsoft/kiota/security/advisories/GHSA-7f3j-j7jj-r3vr) and the v1.32.0 release notes (https://github.com/microsoft/kiota/releases/tag/v1.32.0). Where immediate upgrade is not possible, only generate clients from trusted, first-party OpenAPI descriptions and treat any externally-sourced spec as untrusted input; specifically, inspect or strip x-ms-enum values[].description fields for embedded newline/control characters before running the generator (trade-off: manual review does not scale and can miss obfuscated payloads). As a further control, review generated Python modules in code review before importing or running them, and generate in an isolated, non-privileged build sandbox so any injected code executes without access to production credentials (trade-off: adds build-pipeline friction). Regenerate any Python clients that were produced from untrusted specs with a patched version.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 3 packages in nuget, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Kiota is Microsoft's OpenAPI-based HTTP client code generator that turns an OpenAPI/Swagger description into typed client libraries across languages including Python. The vulnerability is a CWE-94 (Improper Control of Generation of Code / code injection) issue in the Python emitter. Kiota reads Microsoft's x-ms-enum vendor extension, whose values[].description fields carry human-readable enum documentation. These strings flow through KiotaBuilder.SetEnumOptions into Documentation.DescriptionTemplate and then PythonConventionService.RemoveInvalidDescriptionCharacters, which failed to strip or escape newline characters. Because Python line comments (#) terminate at a newline, a description containing an embedded newline splits the generated comment line, and any following text is emitted as live Python source at module top level, executing on import. The fix (PR #7735) sanitizes x-ms-enum descriptions before emitting comments/docstrings; a parallel Ruby injection via string interpolation markers was fixed in the same release (PR #7746).
Know when Kiota gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attacker controls a remotely-fetched OpenAPI spec (AV:N, PR:N) but a developer must generate and import the client (UI:R); module-scope code execution yields full C:H/I:H/A:H.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Executive ViewAI
Microsoft Kiota Python client generator versions prior to 1.32.0 contain a code injection flaw that allows arbitrary Python code execution when developers generate client code from OpenAPI specifications controlled by an attacker. This risk affects organizations using Kiota in development and could compromise development environments and production client libraries. Leadership should be concerned about this as a potential supply chain attack vector, particularly if untrusted OpenAPI sources are processed, with no patch currently available.
Until vendor patch is released, validate all OpenAPI descriptions from trusted sources only; implement code review of all generated client output before use; restrict Kiota execution to isolated development environments; prohibit use with externally-sourced or user-supplied OpenAPI specifications; apply static analysis scanning to generated code for suspicious patterns before deployment.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Command injection in Microsoft Kiota before 1.32.5 lets a malicious or compromised OpenAPI description dictate the insta
Path traversal and code injection in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description write
Path traversal in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description inject unvalidated `stat
Code injection in Microsoft Kiota 0.5.0 through pre-1.35.0 allows attacker-controlled text embedded in an OpenAPI descri
PHP code generation in Microsoft Kiota prior to 1.32.4 permits injection of arbitrary PHP code when the generator proces
Code-generation injection in Microsoft Kiota's C# XML documentation-comment writer allows an attacker who controls or co
Code injection in Microsoft Kiota Ruby code generator allows remote code execution through crafted OpenAPI specification
Build-time SSRF, remote file inclusion, and local file inclusion in Microsoft Kiota before 1.32.5 lets an attacker-contr
Code injection in Microsoft Kiota versions prior to 1.31.1 allows attackers who control or tamper with OpenAPI descripti
Arbitrary file write via path traversal in Microsoft Kiota (OpenAPI HTTP client/plugin code generator) before 1.32.5 all
Microsoft Kiota, the OpenAPI-based HTTP client code generator, fails to validate the x-ai-capabilities.response_semantic
EUVD-2026-44927
GHSA-7f3j-j7jj-r3vr
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB