CVE-2026-59860: CWE-94: Improper Control of Generation of Code ('Code Injection') in microsoft kiota
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.3, Kiota is affected by a code-generation injection vulnerability in the C# XML documentation-comment sink (the description, externalDocs label, and externalDocs link fields emitted as /// … comments). When text from an OpenAPI description is written into single-line XML doc comments without stripping newline and Unicode line-terminator characters, an attacker can break out of the /// comment line and inject additional code into generated C# clients. This issue is fixed in version 1.29.1 and 1.32.3.
AI Analysis
Technical Summary
Kiota versions <1.29.1 and >=1.30.0 <1.32.3 are vulnerable to a code injection flaw (CWE-94) in the C# XML documentation comment sink. The vulnerability arises because newline and Unicode line-terminator characters in OpenAPI description fields (such as description, externalDocs label, and link) are not stripped before being emitted as /// comments. An attacker controlling or tampering with the OpenAPI description can inject code that escapes the comment context and becomes part of the generated C# client source code. This malicious code executes during the build process of the client. The issue is mitigated by upgrading to Kiota versions 1.29.1, 1.32.3, or later, which sanitize these inputs by removing problematic characters before code generation.
Potential Impact
If exploited, an attacker can inject arbitrary C# code into the generated client source code, which will execute when the client is built by developers or CI systems. This can lead to execution of malicious code such as launching processes or other harmful actions. The vulnerability requires the OpenAPI description to be untrusted or compromised, limiting the risk to scenarios where API specifications are sourced from attackers or tampered with. There is no indication of active exploitation in the wild.
Mitigation Recommendations
Upgrade Kiota to version 1.32.3 or later. Additionally, regenerate or refresh any previously generated clients to replace vulnerable code with the fixed version that strips newline and Unicode line-terminator characters from documentation comment fields. Avoid generating clients from untrusted or tampered OpenAPI descriptions to reduce risk.
CVE-2026-59860: CWE-94: Improper Control of Generation of Code ('Code Injection') in microsoft kiota
Description
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.3, Kiota is affected by a code-generation injection vulnerability in the C# XML documentation-comment sink (the description, externalDocs label, and externalDocs link fields emitted as /// … comments). When text from an OpenAPI description is written into single-line XML doc comments without stripping newline and Unicode line-terminator characters, an attacker can break out of the /// comment line and inject additional code into generated C# clients. This issue is fixed in version 1.29.1 and 1.32.3.
CVSS v4.0
Score 8.7high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Kiota versions <1.29.1 and >=1.30.0 <1.32.3 are vulnerable to a code injection flaw (CWE-94) in the C# XML documentation comment sink. The vulnerability arises because newline and Unicode line-terminator characters in OpenAPI description fields (such as description, externalDocs label, and link) are not stripped before being emitted as /// comments. An attacker controlling or tampering with the OpenAPI description can inject code that escapes the comment context and becomes part of the generated C# client source code. This malicious code executes during the build process of the client. The issue is mitigated by upgrading to Kiota versions 1.29.1, 1.32.3, or later, which sanitize these inputs by removing problematic characters before code generation.
Potential Impact
If exploited, an attacker can inject arbitrary C# code into the generated client source code, which will execute when the client is built by developers or CI systems. This can lead to execution of malicious code such as launching processes or other harmful actions. The vulnerability requires the OpenAPI description to be untrusted or compromised, limiting the risk to scenarios where API specifications are sourced from attackers or tampered with. There is no indication of active exploitation in the wild.
Mitigation Recommendations
Upgrade Kiota to version 1.32.3 or later. Additionally, regenerate or refresh any previously generated clients to replace vulnerable code with the fixed version that strips newline and Unicode line-terminator characters from documentation comment fields. Avoid generating clients from untrusted or tampered OpenAPI descriptions to reduce risk.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-07T15:41:53.606Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a58ef3568715ace43306138
Added to database: 07/16/2026, 14:48:21 UTC
Last enriched: 08/17/2026, 16:25:29 UTC
Last updated: 08/30/2026, 10:52:10 UTC
Views: 102
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.