CVE-2026-59860

Kiota: XML Doc-Comment Newline Breakout Code Injection

Published Jul 16, 2026 CVSS 4.0 · 8.7 High EPSS 1.4% KEV · Not listed
Description
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.3, Kiota is 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. This issue is fixed in version 1.29.1 and 1.32.3.

Analysis

AI-generated

Technical impact

Kiota is a code generator that turns OpenAPI specifications into C# clients. In versions before 1.29.1 and 1.32.3, the generator writes OpenAPI description fields—including the description, externalDocs label, and externalDocs link—directly into single-line XML documentation comments (/// …). Because newline and Unicode line-terminator characters are not removed, an attacker can include a crafted OpenAPI description that breaks out of the comment and injects arbitrary C# code into the generated client source. The injected code becomes part of the compiled client and will execute when the client runs, giving the attacker remote code execution capabilities when the client is used.

Affected Systems

Microsoft Kiota, any version earlier than 1.32.3. The vulnerability exists in the code‑generation component of the product and affects all consumers who compile the generated C# clients from untrusted OpenAPI descriptors.

Risk and Exploitability

The CVSS score of 8.7 indicates high severity, while the EPSS score of 1% indicates a low but nonzero likelihood of exploitation, and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires an attacker to supply a malicious OpenAPI spec to the Kiota generator, a scenario that is plausible in environments with dynamic or user-provided specifications. Once the spec is processed, the resulting code can be compiled, allowing the injected code to execute in the client’s runtime environment.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update Kiota to version 1.32.3 or newer to apply the vendor fix.
  • If an immediate upgrade is not possible, validate and sanitize OpenAPI description fields by stripping newline and Unicode line‑terminator characters before passing them to Kiota.
  • Limit the use of Kiota to trusted OpenAPI specifications only, and monitor the project’s repository for additional advisories or patches.

Generated by OpenCVE AI on August 17, 2026 at 20:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-3hrf-2gc2-mx32 Microsoft Kiota: XML Doc-Comment Newline Breakout Code Injection
History
Type Values Removed Values Added
Description Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.32.3, Kiota is 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. This issue is fixed in version 1.32.3. Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.3, Kiota is 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. This issue is fixed in version 1.29.1 and 1.32.3.
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Microsoft
Microsoft kiota
Vendors & Products Microsoft
Microsoft kiota
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.32.3, Kiota is 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. This issue is fixed in version 1.32.3.
Title Kiota: XML Doc-Comment Newline Breakout Code Injection
Weaknesses CWE-94
References
Metrics cvssV4_0

{'score': 8.7, 'vector': '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'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 17, 2026, 3:01 PM
Reserved
Jul 7, 2026, 3:41 PM
Status
Deferred
Published
Jul 16, 2026, 3:16 PM
Modified
Oct 24, 2026, 9:10 PM