Skip to main content

Kiota CVE-2026-59866

| EUVDEUVD-2026-44936 CRITICAL
Path Traversal (CWE-22)
2026-07-16 GitHub_M GHSA-4vv7-jj25-4gh6
9.3
CVSS 4.0 · Vendor: GitHub_M
Share

Severity by source

Vendor (GitHub_M) PRIMARY
9.3 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
7.4 HIGH

Attacker-supplied spec is fetched over network (AV:N) but a developer must run the generator (UI:R); write outside -o escapes the tool's scope (S:C); impact is file-write and code injection (I:H), not disclosure (C:N).

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

4
Patch available
Jul 16, 2026 - 17:03 EUVD
Source Code Evidence Fetched
Jul 16, 2026 - 15:51 vuln.today
Analysis Generated
Jul 16, 2026 - 15:51 vuln.today
CVE Published
Jul 16, 2026 - 14:46 cve.org
CRITICAL 9.3

DescriptionCVE.org

Kiota is an OpenAPI based HTTP Client code generator. Prior to 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.32.5 by GenerationConfiguration.SanitizeClientClassName and SanitizeClientNamespaceName.

AnalysisAI

Path traversal and code injection in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description write generated source files outside the intended output directory and inject arbitrary text into class/namespace declarations. When a developer runs kiota generate without the -c/--class-name flag, Kiota consumes the clientClassName and clientNamespaceName values from the OpenAPI x-ms-kiota-info extension without identifier or path sanitization, using them both as code identifiers and as filesystem path components. There is no public exploit identified at time of analysis and no CISA KEV listing, though the fix (SanitizeClientClassName/SanitizeClientNamespaceName) is visible in the merged patch.

Technical ContextAI

Kiota is Microsoft's OpenAPI-based HTTP client code generator (CLI and library, cpe:2.3:a:microsoft:kiota) used chiefly in the .NET/Microsoft Graph tooling ecosystem to scaffold typed API clients. The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory): the values of the vendor-specific x-ms-kiota-info OpenAPI extension (clientClassName, clientNamespaceName) flowed directly from LanguageInformation.Parse and configuration binding into both generated code identifiers and output path construction with no filtering. Because a namespace like A.B.C maps to nested output directories, unsanitized dots and slashes/.. sequences in these fields allow directory escape from the -o target, while unsanitized identifier characters allow injection of arbitrary text into emitted class/namespace declarations. The 1.32.5 patch adds regex-based sanitization stripping characters outside [a-zA-Z0-9_] (class names) and [a-zA-Z0-9._-] (namespaces), collapsing consecutive dots, and trimming invalid leading characters.

RemediationAI

Vendor-released patch: upgrade Kiota to 1.32.5 or later, which sanitizes clientClassName and clientNamespaceName from settings and the x-ms-kiota-info extension before using them in code or file paths (see release https://github.com/microsoft/kiota/releases/tag/v1.32.5 and advisory https://github.com/microsoft/kiota/security/advisories/GHSA-4vv7-jj25-4gh6). Until upgraded, always pass an explicit -c/--class-name (and an explicit namespace) when running kiota generate, which overrides the attacker-controllable extension values and neutralizes the vector - the trade-off is losing the spec-provided naming convenience. Additionally, only generate clients from OpenAPI descriptions you trust and control, review third-party specs for x-ms-kiota-info entries containing path separators or .. before generation, and run generation in a sandboxed/containerized working directory so any directory escape cannot reach sensitive host paths.

Share

CVE-2026-59866 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy