Description
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.5, Kiota emitted x-ms-kiota-info clientClassName and clientNamespaceName values without identifier or path sanitization as both generated client class or namespace names and generated output path components when `kiota generate` ran without -c/--class-name, allowing an attacker-controlled or compromised OpenAPI description to write generated source outside the -o output directory and inject arbitrary text into generated class or namespace declarations. This issue is fixed in version 1.29.1 and 1.32.5 by GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName.
Published: 2026-07-16
Score: 9.3 Critical
EPSS: 1.4% Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability resides in Kiota, Microsoft's OpenAPI-based HTTP client code generator. Before version 1.29.1 and 1.32.5, Kiota emitted the clientClassName and clientNamespaceName from the x-ms-kiota-info extension without sanitizing identifiers or paths. When the generate command ran without specifying a class name (-c/--class-name), these raw values were used both as generated client class and namespace names and as components of the output file path. An attacker controlling or compromising the OpenAPI document could therefore cause Kiota to write arbitrary files outside the designated output directory and inject malicious text into generated class or namespace declarations. The flaw is mapped to CWE‑22 and CWE‑94. The defect was remedied in 1.29.1 and 1.32.5 by the GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName functions.

Affected Systems

All instances of Microsoft Kiota older than version 1.32.5 are affected. The issue manifests when the generate command is run without specifying a class name (-c or --class-name), allowing unfiltered values from the specification to dictate output paths and class names. Users who generate client code from untrusted or user‑supplied OpenAPI files with these unescaped fields are at risk.

Risk and Exploitability

The CVSS score of 9.3 reflects the high severity of arbitrary file write coupled with code injection. EPSS score of 1% indicates a very low but nonzero probability that attackers are actively exploiting this vulnerability. The lack of input sanitization means the attack can be achieved by any local user running Kiota with a crafted specification. The vulnerability is not yet listed in the CISA KEV catalog. The attack vector is local: an adversary who can influence the OpenAPI spec and has permission to run Kiota can write arbitrary files and inject code, which may lead to execution of malicious payloads when the generated code is later compiled or executed.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Microsoft Kiota to version 1.32.5 or later, which includes sanitization of clientClassName and clientNamespaceName.
  • If an upgrade cannot be performed instantly, restrict the file system permissions of the account that runs Kiota so that it can write only to the designated output directory, preventing creation of files outside that path.
  • Validate any OpenAPI specification before it is fed into Kiota, ensuring that clientClassName and clientNamespaceName values are derived from trusted sources and contain no directory traversal or code injection patterns.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-4vv7-jj25-4gh6 Microsoft Kiota: Arbitrary file write + code-injection via x-ms-kiota-info clientClassName and clientNamespaceName
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.5, Kiota emitted x-ms-kiota-info clientClassName and clientNamespaceName values without identifier or path sanitization as both generated client class or namespace names and generated output path components when `kiota generate` ran without -c/--class-name, allowing an attacker-controlled or compromised OpenAPI description to write generated source outside the -o output directory and inject arbitrary text into generated class or namespace declarations. This issue is fixed in version 1.32.5 by GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName. Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.5, Kiota emitted x-ms-kiota-info clientClassName and clientNamespaceName values without identifier or path sanitization as both generated client class or namespace names and generated output path components when `kiota generate` ran without -c/--class-name, allowing an attacker-controlled or compromised OpenAPI description to write generated source outside the -o output directory and inject arbitrary text into generated class or namespace declarations. This issue is fixed in version 1.29.1 and 1.32.5 by GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName.

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

Type Values Removed Values Added
Metrics ssvc

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


Thu, 16 Jul 2026 16: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
Description Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.32.5, Kiota emitted x-ms-kiota-info clientClassName and clientNamespaceName values without identifier or path sanitization as both generated client class or namespace names and generated output path components when `kiota generate` ran without -c/--class-name, allowing an attacker-controlled or compromised OpenAPI description to write generated source outside the -o output directory and inject arbitrary text into generated class or namespace declarations. This issue is fixed in version 1.32.5 by GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName.
Title Kiota: Arbitrary file write + code-injection via x-ms-kiota-info clientClassName and clientNamespaceName
Weaknesses CWE-22
CWE-94
References
Metrics cvssV4_0

{'score': 9.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/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:03:20.823Z

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

Link: CVE-2026-59866

cve-icon Vulnrichment

Updated: 2026-07-29T18:23:58.959Z

cve-icon NVD

Status : Deferred

Published: 2026-07-16T16:19:15.493

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

Link: CVE-2026-59866

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

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

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-94

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