Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-105796 Overview
CVE-2026-105796 is a code injection vulnerability [CWE-94] in Microsoft Kiota, an OpenAPI-based HTTP client code generator. The flaw affects versions 0.5.0 through 1.34.x and is fixed in 1.35.0. Kiota's Java and PHP documentation-comment sanitizers delete block-comment terminators (*/) instead of neutralizing them. Overlapping characters can reform a terminator and place attacker-controlled OpenAPI text outside the generated documentation comment. The Java sanitizer also strips non-ASCII characters after deleting terminators, which can create a new terminator during normalization. A malicious OpenAPI description can inject source code that executes when a developer or build pipeline compiles the generated output.
Critical Impact
A crafted OpenAPI document can inject arbitrary Java or PHP code into generated clients, leading to code execution in the consuming application or build environment.
Affected Products
- Microsoft Kiota versions 0.5.0 through 1.34.x (Java generation)
- Microsoft Kiota PHP generation in affected releases where supported
- Downstream applications and build pipelines consuming generated Kiota clients
Discovery Timeline
- 2026-10-06 - CVE-2026-105796 published to NVD
- 2026-10-06 - Last updated in NVD database
- Kiota v1.35.0 - Microsoft releases fixed version with GitHub Security Advisory GHSA-rm89-rhwj-9j92
Technical Details for CVE-2026-105796
Vulnerability Analysis
Kiota generates HTTP client source code from OpenAPI specifications. Descriptions in those specs are embedded as documentation comments (/* ... */ in Java and PHP). To prevent breakout, the sanitizer previously deleted the */ terminator from user-controlled text. Deletion is unsafe because adjacent characters can rejoin to form a new terminator. For example, the sequence **// becomes */ once the inner */ is removed. Once an attacker closes the doc comment, subsequent text is parsed as source code and incorporated into the generated client.
The Java path compounds the issue. After deleting */, the sanitizer runs a non-ASCII character replace. Removing a non-ASCII character wedged between * and / creates a fresh */ terminator that bypassed the earlier filter entirely.
Root Cause
The root cause lives in src/Kiota.Builder/Writers/Java/JavaConventionService.cs within RemoveInvalidDescriptionCharacters. The sanitizer called .Replace("*/", string.Empty) and then applied a non-ASCII regex replacement. Both operations are deletions rather than semantic neutralizations, violating safe-escaping guarantees for comment contexts.
Attack Vector
Exploitation requires a developer or CI pipeline to generate Kiota clients from an attacker-influenced OpenAPI document and then compile and load the Java output or load the PHP output. Injected code executes with the privileges of the consuming application or build agent. The attack surface includes public OpenAPI registries, third-party API catalogs, and any workflow that ingests untrusted spec URLs.
// Patch: src/Kiota.Builder/Extensions/StringExtensions.cs
// Neutralize (not delete) block-comment delimiters.
public static string NeutralizeBlockCommentDelimiters(this string? original)
=> string.IsNullOrEmpty(original) ? string.Empty :
original.Replace("/*", "//*", StringComparison.Ordinal)
.Replace("*/", "* /", StringComparison.Ordinal);
// Patch: src/Kiota.Builder/Writers/Java/JavaConventionService.cs
internal static string RemoveInvalidDescriptionCharacters(string originalDescription) =>
string.IsNullOrEmpty(originalDescription) ?
originalDescription :
nonAsciiReplaceRegex()
.Replace(originalDescription.Replace("\\", "/", StringComparison.OrdinalIgnoreCase), string.Empty)
.NeutralizeBlockCommentDelimiters()
.CleanupXMLString();
// Source: https://github.com/microsoft/kiota/commit/68f33b865be9273464a6efbbe17379760e51f1a4
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-105796
Indicators of Compromise
- OpenAPI documents containing description or summary fields with sequences such as **//, *//*, or non-ASCII characters embedded inside * and / pairs.
- Generated Java or PHP source files where executable statements appear immediately after a documentation comment ends unexpectedly.
- Build logs showing unexpected compilation of generated Kiota client files that reference unknown identifiers or imports.
Detection Strategies
- Scan OpenAPI inputs for block-comment delimiters (/*, */) and suspicious adjacency patterns before invoking Kiota.
- Diff generated client code against prior builds to detect new top-level declarations outside method bodies.
- Pin and audit the Kiota version used by CI pipelines; alert on usage of versions earlier than 1.35.0.
Monitoring Recommendations
- Instrument CI runners to log the SHA of OpenAPI inputs and generated outputs for forensic review.
- Monitor build agents for unexpected outbound network connections or process spawns during code generation and compilation.
- Track dependency manifests across repositories to inventory Kiota consumers.
How to Mitigate CVE-2026-105796
Immediate Actions Required
- Upgrade Kiota to version 1.35.0 or later across all developer workstations and build pipelines.
- Regenerate all Java and PHP clients previously produced from third-party or untrusted OpenAPI documents.
- Review generated source trees for injected code introduced before the upgrade.
Patch Information
Microsoft fixed the issue in Kiota release v1.35.0 via Pull Request #8017. The patch replaces deletion of comment delimiters with neutralization, inserting a separator character so that /* becomes //* and */ becomes * /. Full technical details are available in the GitHub Security Advisory GHSA-rm89-rhwj-9j92.
Workarounds
- Restrict Kiota generation inputs to OpenAPI documents from trusted internal sources only.
- Pre-process OpenAPI descriptions to strip or escape /* and */ sequences before passing them to vulnerable Kiota versions.
- Isolate code generation and compilation in ephemeral, network-restricted build containers.
# Upgrade Kiota CLI to the fixed version
dotnet tool update --global Microsoft.OpenApi.Kiota --version 1.35.0
# Verify installed version
kiota --version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

