Impact
The vulnerability is in Kiota, Microsoft’s OpenAPI‑based code generator. When Kiota processes an OpenAPI document that contains x-ms-kiota-info for clientClassName and clientNamespaceName without sanitizing these values, it writes files using the raw names and injects them into generated class and namespace declarations. An attacker can craft a malicious specification that causes Kiota to write arbitrary files outside the intended output directory and embed malicious code in the generated sources, potentially leading to code execution if the generated code is compiled and run. The flaw maps to CWE‑22 (Improper Restriction of Operations within the Bounds of a Memory Buffer) and CWE‑94 (Improper Control of Generation of Code).
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.
OpenCVE Enrichment
Github GHSA