Hoch

Microsoft Kiota: XML Doc-Comment Newline Breakout Code Injection

  • Veröffentlicht: 24.07.2026
  • Aktualisiert: 11.10.2026 11:23

Summary

Kiota versions prior to 1.32.3 and 1.29.1 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.

Impact and Preconditions

This issue is only practically exploitable when:

  1. the OpenAPI description used for generation is from an untrusted source, or
  2. a normally trusted OpenAPI description has been compromised/tampered with.

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.

Affected Versions

  • Affected: all versions < 1.29.1, >= 1.30.0, < 1.32.3
  • Fixed: 1.29.1, 1.32.3, and later

Illustrative Exploit Example

Example OpenAPI fragment (malicious description)

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

Example generated C# snippet before fix (illustrative)

csharp
/// 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 description field, but may also impact the externalDocs label and link text and other doc-comment-derived locations.

Remediation

  1. Upgrade Kiota to 1.32.3 or later.
  2. Regenerate/refresh existing generated clients as a precaution:

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.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
.NET (NuGet) Microsoft.OpenApi.Kiota >= 1.30.0, < 1.32.3, < 1.29.1 1.32.3, 1.29.1
.NET (NuGet) Microsoft.OpenApi.Kiota.Builder >= 1.30.0, < 1.32.3, < 1.29.1 1.32.3, 1.29.1

Verweise

CVSS-Wert -
CVSS-Vektor
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Schwäche (CWE)
CWE-94
Plattform
.NET (NuGet)
Paket
Microsoft.OpenApi.Kiota, Microsoft.OpenApi.Kiota.Builder
Veröffentlicht
24.07.2026
Aktualisiert
11.10.2026 11:23

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-3hrf-2gc2-mx32 - CC BY 4.0

Schwachstellenhistorie: Microsoft.OpenApi.Kiota.Builder

Alle veröffentlichten Schwachstellen dieses Pakets (.NET (NuGet)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (12) im Archiv
Einträge insgesamt
12
Erste → letzte
04.2026 10.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 2
  • Hoch 9
  • Niedrig 1

Veröffentlichungen pro Jahr

  1. 2026: 12
Schweregrad:
  1. Kritisch CVE-2026-59865 >= 1.30.0, < 1.32.5, < 1.29.1 1.32.5, 1.29.1
  2. Hoch CVE-2026-59863 >= 1.30.0, < 1.32.5, < 1.29.1 1.32.5, 1.29.1
  3. Hoch · 7.1 CVE-2026-59867 >= 1.30.0, < 1.32.5, < 1.29.1 1.32.5, 1.29.1
  4. Kritisch CVE-2026-59864 >= 1.30.0, < 1.32.5, < 1.29.1 1.32.5, 1.29.1
  5. Hoch CVE-2026-59859 >= 1.30.0, < 1.32.4, < 1.29.1 1.32.4, 1.29.1
  6. Hoch · 7.5 CVE-2026-59862 >= 1.30.0, < 1.32.0, < 1.29.1 1.32.0, 1.29.1
  7. Hoch · 7.5 CVE-2026-59861 >= 1.30.0, < 1.32.0, < 1.29.1 1.32.0, 1.29.1
  8. Microsoft Kiota: XML Doc-Comment Newline Breakout Code Injection dieser Eintrag
    Hoch CVE-2026-59860 >= 1.30.0, < 1.32.3, < 1.29.1 1.32.3, 1.29.1
  9. Hoch · 0.0 CVE-2026-41134 >= 1.30.0, < 1.31.1, < 1.29.1 1.31.1, 1.29.1

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.