CVE-2026-59861: microsoft kiota · Code Injection
Affects microsoft kiotaSource CVE Database V5
Not known to be exploited · CVSS 7.5 High : upgrade to 1.31.1 or 1.29.1 soon.
Data as of 27 Nov 2026, 22:51 UTC
- EPSS
- 2.0% chance of exploitation in 30 days – higher than 81% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 1.31.1, 1.29.1, 1.32.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HExploitation evidence
Disclosed: evidence found.
CVE published 16 Jul 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 28 Nov 2026.
What to do
Upgrade kiota to 1.31.1 or 1.29.1; Microsoft.OpenAPI.Kiota and Microsoft.OpenAPI.Kiota.Builder to 1.32.0; Microsoft.OpenApi.Kiota and Microsoft.OpenApi.Kiota.Builder to 1.29.1.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| microsoftkiota | Affected
| Fixed in
|
| microsoftkiota | Affected
| Fixed in
|
NuGetMicrosoft.OpenAPI.Kiotapkg:nuget/Microsoft.OpenAPI.KiotaOther threats | Affected
| Fixed in
|
NuGetMicrosoft.OpenApi.Kiotapkg:nuget/Microsoft.OpenApi.KiotaOther threats | Affected
| Fixed in
|
NuGetMicrosoft.OpenAPI.Kiota.Builderpkg:nuget/Microsoft.OpenAPI.Kiota.BuilderOther threats | Affected
| Fixed in
|
NuGetMicrosoft.OpenApi.Kiota.Builderpkg:nuget/Microsoft.OpenApi.Kiota.BuilderOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade Microsoft Kiota to version 1.29.1, 1.32.0, or later to apply the official fix. Regenerate all existing Ruby clients using the updated Kiota to replace vulnerable generated code. If immediate upgrade is not possible, audit and sanitize OpenAPI specification files to remove or replace # characters in default values and property names. Implement mandatory code reviews of generated Ruby files to detect suspicious string interpolation patterns. Restrict OpenAPI specs to trusted internal sources and avoid automatic generation from untrusted external specs. Do not deploy generated Ruby code to production unless the specification source is verified and reviewed. As a temporary measure, manually escape # characters in generated string literals by replacing # with \#.
Description
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.0, Kiota's Ruby generator embedded OpenAPI default fields, property names, and other schema-derived strings through CodeMethodWriter.cs and SanitizeForQuotedLiteral() in Writers/StringExtensions.cs into Ruby double-quoted literals without escaping #, allowing attacker-controlled #{expr}, #$var, or #@var interpolation markers to inject arbitrary Ruby code into generated model classes. This issue is fixed in version 1.29.1 and 1.32.0.
References
- github.com/microsoft/kiota/security/advisories/GHSA-xg2h-5xr2-29jw (opens in a new tab)
- github.com/microsoft/kiota/pull/7746 (opens in a new tab)
- github.com/microsoft/kiota/commit/fee1b648bb4394ba7ba72de9c0ce4f2a0bad0cb6 (opens in a new tab)
- github.com/microsoft/kiota/releases/tag/v1.32.0 (opens in a new tab)