CVE-2026-59866: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in microsoft kiota
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.
AI Analysis
Technical Summary
Microsoft Kiota improperly limits pathnames to a restricted directory (CWE-22) and allows code injection into generated client declarations (CWE-94) by emitting the clientClassName and clientNamespaceName values from the x-ms-kiota-info OpenAPI extension raw and unsanitized. When generating clients without specifying a class name, an attacker controlling the OpenAPI description can cause the generation process to write files outside the designated output directory and inject arbitrary text into class or namespace declarations. This was confirmed in Kiota 1.32.4. The vulnerability does not enable remote code execution because injected code breaks the build, but it can cause integrity issues and denial of service. The issue is fixed in versions 1.29.1 and 1.32.5 by sanitizing these values to remove unsafe characters and path separators.
Potential Impact
An attacker who controls or tampers with the OpenAPI description used by Kiota to generate client code can cause files to be written outside the intended output directory, potentially overwriting arbitrary files. Additionally, they can inject arbitrary text into the generated client code, corrupting the build process and causing denial of service. However, this vulnerability does not allow remote code execution because the injected code breaks compilation. The primary impact is integrity compromise and denial of service during client generation.
Mitigation Recommendations
Upgrade Microsoft Kiota to version 1.29.1, 1.32.5, or later. These versions include fixes that sanitize the clientClassName and clientNamespaceName values sourced from the x-ms-kiota-info extension, removing unsafe characters and path separators to prevent path traversal and code injection. Regenerate any affected clients after upgrading. No other mitigation is required as the issue is addressed by these official fixes.
CVE-2026-59866: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in microsoft kiota
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.
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 improperly limits pathnames to a restricted directory (CWE-22) and allows code injection into generated client declarations (CWE-94) by emitting the clientClassName and clientNamespaceName values from the x-ms-kiota-info OpenAPI extension raw and unsanitized. When generating clients without specifying a class name, an attacker controlling the OpenAPI description can cause the generation process to write files outside the designated output directory and inject arbitrary text into class or namespace declarations. This was confirmed in Kiota 1.32.4. The vulnerability does not enable remote code execution because injected code breaks the build, but it can cause integrity issues and denial of service. The issue is fixed in versions 1.29.1 and 1.32.5 by sanitizing these values to remove unsafe characters and path separators.
Potential Impact
An attacker who controls or tampers with the OpenAPI description used by Kiota to generate client code can cause files to be written outside the intended output directory, potentially overwriting arbitrary files. Additionally, they can inject arbitrary text into the generated client code, corrupting the build process and causing denial of service. However, this vulnerability does not allow remote code execution because the injected code breaks compilation. The primary impact is integrity compromise and denial of service during client generation.
Mitigation Recommendations
Upgrade Microsoft Kiota to version 1.29.1, 1.32.5, or later. These versions include fixes that sanitize the clientClassName and clientNamespaceName values sourced from the x-ms-kiota-info extension, removing unsafe characters and path separators to prevent path traversal and code injection. Regenerate any affected clients after upgrading. No other mitigation is required as the issue is addressed by these official fixes.
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: 08/17/2026, 16:23:59 UTC
Last updated: 08/29/2026, 22:52:12 UTC
Views: 86
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.