Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
.NET NuGet
Not in CISA KEV

Microsoft Kiota: XML Doc-Comment Newline Breakout Code InjectionGHSA-3hrf-2gc2-mx32

Fix: microsoft/kiota#7831

GHSA-3hrf-2gc2-mx32 is a Code Injection vulnerability in Microsoft.OpenApi.Kiota. A fix is available for Microsoft.OpenApi.Kiota — see the affected versions and patch details below.

Also known asCVE-2026-59860
Published
Updated
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed
Exploitation data as of Oct 17, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • A successful exploit gives an attacker total control of the affected component, not partial access.
  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for GHSA-3hrf-2gc2-mx32.

EPSS Exploitation Probability

via FIRST.org ↗
1.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs72th percentile — riskier than 72% of all scored CVEsHighest risk
0.52%0.97%1.43%1.88%1.0%1.4%1.4%1.4%Aug 26Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

Real-World Exposure

4 pkgs affected
.NETMicrosoft.OpenApi.Kiota.NETMicrosoft.OpenApi.Kiota.Builder.NETMicrosoft.OpenApi.Kiota.NETMicrosoft.OpenApi.Kiota.Builder

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects NuGet packages — download data is not available via public APIs for these ecosystems.

Description

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)

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)

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

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
.NETNuGetMicrosoft.OpenApi.Kiota≥ 1.30.0&&< 1.32.31.32.3dotnet add package Microsoft.OpenApi.Kiota --version 1.32.3
.NETNuGetMicrosoft.OpenApi.Kiota.Builder≥ 1.30.0&&< 1.32.31.32.3dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.32.3
.NETNuGetMicrosoft.OpenApi.Kiotaall versions1.29.1dotnet add package Microsoft.OpenApi.Kiota --version 1.29.1
.NETNuGetMicrosoft.OpenApi.Kiota.Builderall versions1.29.1dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.29.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for Microsoft.OpenApi.Kiota, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update Microsoft.OpenApi.Kiota to 1.32.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3hrf-2gc2-mx32 is resolved across your whole dependency graph.

  3. Workarounds

    Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.

Frequently Asked Questions

### 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.
O3 Security · Impact-Aware SCA

Is GHSA-3hrf-2gc2-mx32 in your dependencies?

Find it across NuGet, including transitive dependencies.

Microsoft Kiota: XML Doc-Comment Newline Breakout…