CVE-2026-59860High▾ TwilightMicrosoft Kiota: XML Doc-Comment Newline Breakout Code Injection
▾ Twilight zone — High severity, or a signal on a lesser flaw
impact 41.3 · likelihood 0.3 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 24.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via GHSA
1.0%
1.0% → 1.4%
Kiota versions prior to 1.32.3 are 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 only practically exploitable when:
The injected code is compiled (and may execute) when the developer or CI builds the generated client. If you only generate from trusted, integrity-protected API descriptions, risk is significantly reduced.
openapi: 3.0.1
info:
title: Exploit Demo
version: 1.0.0
description: |-
Legitimate summary text
public static class Pwned { static Pwned() { System.Diagnostics.Process.Start("calc.exe"); } }
The newline inside description (also exploitable via \r, U+0085, U+2028, U+2029) terminates the doc-comment line.
/// Legitimate summary text
public static class Pwned { static Pwned() { System.Diagnostics.Process.Start("calc.exe"); } }
The injected payload escapes the intended /// comment context and introduces attacker-controlled statements in generated code.
Note: this exploit is not limited to the
descriptionfield, but may also impact theexternalDocslabel and link text and other doc-comment-derived locations.
Refreshing generated clients ensures previously generated vulnerable code is replaced with hardened output. The fix (PR microsoft/kiota#7831) strips \r, \n, \u0085, \u2028, \u2029 (and normalizes tabs) from description, label, and link text before emitting doc comments.
Microsoft.OpenApi.Kiota < 1.32.3Microsoft.OpenApi.Kiota.Builder < 1.32.3Upgrade to a patched release:
Microsoft.OpenApi.Kiota 1.32.3Microsoft.OpenApi.Kiota.Builder 1.32.3Connected by shared product, vendor, weakness, or advisory.
CVE-2026-59861High· 7.5Microsoft Kiota: Code Generation Literal Injection in Kiota Ruby Generator
CVE-2026-59862High· 7.5Microsoft Kiota: Code Generation Literal Injection in Kiota Python Generator
CVE-2026-59859HighMicrosoft Kiota: Code Generation Literal Injection in Kiota PHP Generator
CVE-2026-59865CriticalMicrosoft Kiota: Command injection via x-ms-kiota-info dependencyInstallCommand surfaced by `kiota info`
CVE-2026-59866HighMicrosoft Kiota: Arbitrary file write + code-injection via x-ms-kiota-info clientClassName and clientNamespaceName
CVE-2025-14576High· 7.8Insufficient validation of node IDs in Qt SVG module allows arbitrary QML/JavaScript code injection when loading malicious SVG files through the VectorImage component in Qt Quick