CVE-2026-59866: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in microsoft kiota
CVE-2026-59866 is a critical path traversal vulnerability in Microsoft Kiota, an OpenAPI-based HTTP client code generator. Versions prior to 1.32.5 fail to sanitize client class and namespace names derived from attacker-controlled OpenAPI descriptions, allowing writing of generated source files outside the intended output directory and injection of arbitrary text into generated code. This can lead to unauthorized file writes and code injection during code generation. The issue is fixed in version 1.32.5 by adding sanitization for client class and namespace names.
AI Analysis
Technical Summary
Microsoft Kiota versions before 1.32.5 do not properly sanitize the x-ms-kiota-info clientClassName and clientNamespaceName values when generating client code. When the 'kiota generate' command runs without specifying a class name, these unsanitized values are used both as generated client class or namespace names and as components of the output file path. This improper limitation of pathname allows an attacker-controlled or compromised OpenAPI description to cause path traversal, writing files outside the designated output directory and injecting arbitrary text into generated source code. The vulnerability is addressed in version 1.32.5 by implementing GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName to sanitize these values.
Potential Impact
An attacker who can supply or modify the OpenAPI description used by Kiota can exploit this vulnerability to write files outside the intended output directory during code generation. This can lead to arbitrary code injection in generated client classes or namespaces, potentially compromising the build environment or downstream consumers of the generated code. The vulnerability has a high CVSS 4.0 score of 9.3, indicating critical impact with network attack vector, no privileges or user interaction required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade Microsoft Kiota to version 1.32.5 or later, where the vulnerability is fixed by sanitizing client class and namespace names. Until upgrading, avoid generating code from untrusted or attacker-controlled OpenAPI descriptions. No other official fixes or temporary mitigations are documented. Patch status is confirmed fixed in 1.32.5.
CVE-2026-59866: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in microsoft kiota
Description
CVE-2026-59866 is a critical path traversal vulnerability in Microsoft Kiota, an OpenAPI-based HTTP client code generator. Versions prior to 1.32.5 fail to sanitize client class and namespace names derived from attacker-controlled OpenAPI descriptions, allowing writing of generated source files outside the intended output directory and injection of arbitrary text into generated code. This can lead to unauthorized file writes and code injection during code generation. The issue is fixed in version 1.32.5 by adding sanitization for client class and namespace names.
CVSS v4.0
Score 9.3critical
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Microsoft Kiota versions before 1.32.5 do not properly sanitize the x-ms-kiota-info clientClassName and clientNamespaceName values when generating client code. When the 'kiota generate' command runs without specifying a class name, these unsanitized values are used both as generated client class or namespace names and as components of the output file path. This improper limitation of pathname allows an attacker-controlled or compromised OpenAPI description to cause path traversal, writing files outside the designated output directory and injecting arbitrary text into generated source code. The vulnerability is addressed in version 1.32.5 by implementing GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName to sanitize these values.
Potential Impact
An attacker who can supply or modify the OpenAPI description used by Kiota can exploit this vulnerability to write files outside the intended output directory during code generation. This can lead to arbitrary code injection in generated client classes or namespaces, potentially compromising the build environment or downstream consumers of the generated code. The vulnerability has a high CVSS 4.0 score of 9.3, indicating critical impact with network attack vector, no privileges or user interaction required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade Microsoft Kiota to version 1.32.5 or later, where the vulnerability is fixed by sanitizing client class and namespace names. Until upgrading, avoid generating code from untrusted or attacker-controlled OpenAPI descriptions. No other official fixes or temporary mitigations are documented. Patch status is confirmed fixed in 1.32.5.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-07T15:41:53.607Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a58f9c068715ace434105f4
Added to database: 07/16/2026, 15:33:20 UTC
Last enriched: 07/16/2026, 15:47:39 UTC
Last updated: 07/17/2026, 00:18:32 UTC
Views: 12
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.