CVE-2026-59861 Details
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.
A code generation literal injection vulnerability has been identified in the Microsoft Kiota Ruby HTTP client code generator, affecting versions prior to 1.32.0. The issue arises because the generator embeds string values from OpenAPI default fields and property names directly into Ruby double-quoted string literals without properly escaping the '#' character. This oversight allows an attacker to inject arbitrary Ruby code into generated model classes by exploiting the interpolation markers #{expr}, #$var, or #@var. The vulnerability is rooted in the 'SanitizeForQuotedLiteral' function, which fails to escape the '#' character, enabling the injection of malicious code that could be executed at runtime.
Users are advised to upgrade Kiota to version 1.32.0 or later. After upgrading, regenerate any previously generated Ruby clients to ensure that the injected code has been removed and replaced with the sanitized version.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jul 16, 2026CISA-ADP
Assessed Jul 17, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/microsoft/kiota/commit/fee1b648bb4394ba7ba72de9c0ce4f2a0bad0cb6 | [email protected] | Source CodeVendor |
| https://github.com/microsoft/kiota/pull/7746 | [email protected] | Issue TrackingVendor |
| https://github.com/microsoft/kiota/releases/tag/v1.32.0 | [email protected] | Release NotesVendor |
| https://github.com/microsoft/kiota/security/advisories/GHSA-xg2h-5xr2-29jw | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Microsoft Kiota | < 1.32.0 (semver) |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 17, 2026 | CVE Modified | [email protected] |
| Jul 29, 2026 | CVE Modified | CISA-ADP |
| Jul 17, 2026 | CVE Modified | CISA-ADP |
| Jul 16, 2026 | CVE Modified | CISA-ADP |
| Jul 16, 2026 | New CVE Received | [email protected] |
Volerion