Code Injection in Microsoft.OpenApi.Kiota (CVE-2026-59860)
Summary
Code injection in Microsoft.OpenApi.Kiota (CVE-2026-59860). Risk of unauthorized operations or information disclosure. Exploitable via description. Mitigation: upgrade to 1.29.1 or later.
Original description
The description as published by the source.
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:
- the OpenAPI description used for generation is from an untrusted source, or
- 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) termi…
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-59860 has been found in Microsoft.OpenApi.Kiota.
Attackers can target a specific entry point like description over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade Microsoft.OpenApi.Kiota to 1.29.1 or later.
If unsure, ask your IT team or search "Microsoft.OpenApi.Kiota CVE-2026-59860" on the vendor's site.
CVE-2026-59860 (Microsoft.OpenApi.Kiota) — CWE-94
Attack surface: description / externalDocs
Patched: 1.29.1 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Arbitrary code execution (CWE-94) exists in Microsoft.OpenApi.Kiota. Attackers reach the vulnerable code path via description.
Check the vendor advisory for the affected versions of Microsoft.OpenApi.Kiota. Attack surface: description / externalDocs.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 1.29.1.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'Microsoft.OpenApi.Kiota' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'Microsoft.OpenApi.Kiota' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
Microsoft.OpenApi.Kiotaを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade Microsoft.OpenApi.Kiota to 1.29.1ステージング環境で 1.29.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com