CVE-2026-105796: Kiota: Code injection through doc-comment delimiter reformation in Kiota Java and PHP generators
Impact An attacker who controls or tampers with an OpenAPI description can cause Kiota to emit attacker-controlled Java or PHP source outside a generated documentation comment. The affected sanitizers remove comment terminators rather than neutralizing them, allowing a terminator to reform from overlapping characters or from subsequent normalization.
Published Oct 6, 2026
Affected packages
Microsoft.OpenApi.Kiota
- Ecosystem
- NuGet
- Affected
- >= 0.5.0, < 1.35.0
- Fixed in
- 1.35.0
- Check
dotnet list package --include-transitive
Microsoft.OpenApi.Kiota.Builder
- Ecosystem
- NuGet
- Affected
- >= 0.5.0, < 1.35.0
- Fixed in
- 1.35.0
- Check
dotnet list package --include-transitive
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
An attacker who controls or tampers with an OpenAPI description can cause Kiota to emit attacker-controlled Java or PHP source outside a generated documentation comment. The affected sanitizers remove comment terminators rather than neutralizing them, allowing a terminator to reform from overlapping characters or from subsequent normalization. The Java sanitizer also removes non-ASCII characters after removing terminators, which can create a new terminator.
Exploitation requires a developer or build pipeline to generate a client from the malicious description and subsequently compile and load the Java output, or load the PHP output. Code executes in the consuming application's or build environment's security context, not merely because Kiota reads the description.
Affected versions
The affected NuGet packages are Microsoft.OpenApi.Kiota and Microsoft.OpenApi.Kiota.Builder. The Java normalization-order defect was introduced in version 0.5.0 and remains present through version 1.34.1, including the separate 1.29.1 security-backport release. The PHP delimiter-reformation variant is also present in version 1.34.1 and 1.29.1. Version 1.35.0 fixes both variants.
The package version range below reflects the Java defect; it does not assert that PHP generation existed in every version in that range.
Patches
Upgrade to Kiota 1.35.0 or later and regenerate affected clients. The fix neutralizes block-comment delimiters instead of deleting them, and performs Java delimiter neutralization after non-ASCII normalization.
- Fix: https://github.com/microsoft/kiota/pull/8017
- Fixed release: https://github.com/microsoft/kiota/releases/tag/v1.35.0
Workarounds
Until upgrading, generate clients only from trusted, integrity-protected OpenAPI descriptions. Review generated Java and PHP source before compiling, loading, or deploying it. Restrict the privileges and secrets available to generation and build environments.
Related advisories
This is distinct from PHP double-quoted string interpolation (GHSA-jqwh-526h-c92j) and C# XML documentation newline breakout (GHSA-3hrf-2gc2-mx32). Those fixes do not address Java/PHP block-comment delimiter reformation.
Credited to gavinbarron.
References
- https://github.com/microsoft/kiota/security/advisories/GHSA-rm89-rhwj-9j92
- https://nvd.nist.gov/vuln/detail/CVE-2026-105796
- https://github.com/microsoft/kiota/pull/8017
- https://github.com/microsoft/kiota/commit/68f33b865be9273464a6efbbe17379760e51f1a4
- https://github.com/microsoft/kiota/releases/tag/v1.35.0
- https://github.com/advisories/GHSA-rm89-rhwj-9j92
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More NuGet vulnerabilities
All NuGet entriesCVE-2026-105795
Kiota: Unsafe oauth_card_path references in Kiota-generated API plugin manifests
low3.1Oct 6, 2026CVE-2026-59859
Microsoft Kiota: Code Generation Literal Injection in Kiota PHP Generator
high8.7Jul 24, 2026CVE-2026-59860
Microsoft Kiota: XML Doc-Comment Newline Breakout Code Injection
high8.7Jul 24, 2026CVE-2026-59861
Microsoft Kiota: Code Generation Literal Injection in Kiota Ruby Generator
high7.5Jul 24, 2026CVE-2026-59862
Microsoft Kiota: Code Generation Literal Injection in Kiota Python Generator
high7.5Jul 24, 2026CVE-2026-59863
Microsoft Kiota Workspace-config poisoning: out-of-repo file write + generation-time SSRF
high7.0Jul 24, 2026
