Skip to main content

Microsoft Kiota CVE-2026-59862

| EUVDEUVD-2026-44927 HIGH
Code Injection (CWE-94)
2026-07-16 GitHub_M GHSA-7f3j-j7jj-r3vr
7.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious OpenAPI spec with newline in x-ms-enum description
  2. Delivery
    Deliver spec to victim developer or CI
  3. Exploit
    Victim runs Kiota Python generator (<1.32.0)
  4. Execution
    Payload emitted as module-scope Python code
  5. Persist
    Victim imports generated module
  6. Impact
    Arbitrary 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 1.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

kiota < 1.32.0

Affected Packages

nuget microsoft.openapi.kiota fix: 1.29.1, 1.32.0
nuget microsoft.openapi.kiota.builder fix: 1.29.1, 1.32.0
euvd kiota fix: 1.32.0

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

Vendor (GitHub_M) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 8.8 HIGH

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.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
Patch available
Jul 16, 2026 - 17:03 EUVD
CVE Published
Jul 16, 2026 - 14:38 cve.org
HIGH 7.5

DescriptionCVE.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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
1.0%
Top 40% exploitable
Prevalence
Low
niche Microsoft OpenAPI code-gen CLI, build-time developer tooling only
Threat Intel
1
1 sources
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA CIRCL GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 1.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

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.

More in Kiota

View all
CVE-2026-59865 CRITICAL
9.3 Jul 16

Command injection in Microsoft Kiota before 1.32.5 lets a malicious or compromised OpenAPI description dictate the insta

CVE-2026-59866 CRITICAL
9.3 Jul 16

Path traversal and code injection in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description write

CVE-2026-59864 CRITICAL
9.3 Jul 16

Path traversal in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description inject unvalidated `stat

CVE-2026-105796 HIGH
8.8 Oct 06

Code injection in Microsoft Kiota 0.5.0 through pre-1.35.0 allows attacker-controlled text embedded in an OpenAPI descri

CVE-2026-59859 HIGH
8.7 Jul 16

PHP code generation in Microsoft Kiota prior to 1.32.4 permits injection of arbitrary PHP code when the generator proces

CVE-2026-59860 HIGH
8.7 Jul 16

Code-generation injection in Microsoft Kiota's C# XML documentation-comment writer allows an attacker who controls or co

CVE-2026-59861 HIGH
7.5 Jul 16

Code injection in Microsoft Kiota Ruby code generator allows remote code execution through crafted OpenAPI specification

CVE-2026-59867 HIGH
7.1 Jul 16

Build-time SSRF, remote file inclusion, and local file inclusion in Microsoft Kiota before 1.32.5 lets an attacker-contr

CVE-2026-41134 HIGH
7.3 Apr 22

Code injection in Microsoft Kiota versions prior to 1.31.1 allows attackers who control or tamper with OpenAPI descripti

CVE-2026-59863 HIGH
7.0 Jul 16

Arbitrary file write via path traversal in Microsoft Kiota (OpenAPI HTTP client/plugin code generator) before 1.32.5 all

CVE-2026-105795 LOW POC
3.1 Oct 06

Microsoft Kiota, the OpenAPI-based HTTP client code generator, fails to validate the x-ai-capabilities.response_semantic

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy