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.
OpenCVE Enrichment
Github GHSA