Advisory Database
  • Advisories
  • Dependency Scanning
  1. nuget
  2. ›
  3. Microsoft.OpenApi.Kiota.Builder
  4. ›
  5. CVE-2026-59866

CVE-2026-59866: Microsoft Kiota: Arbitrary file write + code-injection via x-ms-kiota-info clientClassName and clientNamespaceName

July 24, 2026 (updated August 17, 2026)

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 -o output 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. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 1.29.1, all versions starting from 1.30.0 before 1.32.5

Fixed versions

  • 1.29.1
  • 1.32.5

Solution

Upgrade to versions 1.29.1, 1.32.5 or above.

Impact 7.1 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

nuget/Microsoft.OpenApi.Kiota.Builder/CVE-2026-59866.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:04 +0000.