CVE-2026-59866: Microsoft Kiota: Arbitrary file write + code-injection via x-ms-kiota-info clientClassName and clientNamespaceName
Microsoft Kiota emitted the x-ms-kiota-info extension’s clientClassName or clientNamespaceName value
raw, with no identifier or path sanitization, as both the generated client’s class/namespace name
and part of the generated output path. When kiota generate is run without -c/--class-name — the
zero-config workflow that x-ms-kiota-info is explicitly designed for (the API provider supplies the names in
the description so consumers don’t have to) — an attacker who controls or tampers with the OpenAPI description
could therefore:
- (CWE-22) write the generated source file to a path outside the
-ooutput directory — e.g.clientClassName: "/var/www/html/shell"; and - (CWE-94) inject arbitrary text into the generated class/namespace declaration, corrupting the generated client.
Confirmed on Kiota 1.32.4 (the self-contained linux-x64 release binary), i.e. after the earlier
writer-sink hardening — that fix escaped property/enum/default/serialization sinks but never sanitized the
provider-supplied clientClassName / clientNamespaceName.
References
- github.com/advisories/GHSA-4vv7-jj25-4gh6
- github.com/microsoft/kiota/commit/dc812dbbf88ef7edf53a890d36b2f9d1460e947d
- github.com/microsoft/kiota/pull/7884
- github.com/microsoft/kiota/releases/tag/v1.32.5
- github.com/microsoft/kiota/security/advisories/GHSA-4vv7-jj25-4gh6
- nvd.nist.gov/vuln/detail/CVE-2026-59866
Code Behaviors & Features
Detect and mitigate CVE-2026-59866 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →