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.
Published: 2026-07-16
Score: 8.7 High
EPSS: 1.4% Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Mon, 17 Aug 2026 15:15:00 +0000

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.

Wed, 29 Jul 2026 20:30:00 +0000

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'}


Thu, 16 Jul 2026 15:45:00 +0000

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

Thu, 16 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Thu, 16 Jul 2026 14:45:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-17T15:01:37.307Z

Reserved: 2026-07-07T15:41:53.606Z

Link: CVE-2026-59860

cve-icon Vulnrichment

Updated: 2026-07-16T14:52:37.729Z

cve-icon NVD

Status : Deferred

Published: 2026-07-16T15:16:35.310

Modified: 2026-08-17T15:16:56.407

Link: CVE-2026-59860

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-17T20:30:17Z

Weaknesses
  • CWE-94

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