CVE-2026-59861: CWE-94: Improper Control of Generation of Code ('Code Injection') in microsoft kiota
Kiota is an OpenAPI based HTTP Client code generator. Prior to 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.32.0.
AI Analysis
Technical Summary
Microsoft Kiota is an OpenAPI-based HTTP client code generator. In versions before 1.32.0, the Ruby code generator improperly handles schema-derived strings by embedding them into double-quoted Ruby literals without escaping interpolation markers. This improper control of code generation (CWE-94) allows an attacker to inject arbitrary Ruby code via crafted OpenAPI inputs containing #{expr}, #$var, or #@var sequences. The vulnerability is resolved in version 1.32.0.
Potential Impact
An attacker who can influence OpenAPI schema inputs used by Kiota's Ruby generator can inject arbitrary Ruby code into generated model classes. This can lead to execution of malicious code when the generated code is run. The CVSS score is 7.5 (high), indicating significant impact primarily on availability (denial of service) but potentially also on integrity or other aspects depending on usage.
Mitigation Recommendations
Upgrade to Kiota version 1.32.0 or later, where this code injection vulnerability is fixed by properly escaping interpolation markers in Ruby code generation. No other official remediation or temporary fixes are indicated. Patch status is confirmed fixed in 1.32.0.
CVE-2026-59861: CWE-94: Improper Control of Generation of Code ('Code Injection') in microsoft kiota
Description
Kiota is an OpenAPI based HTTP Client code generator. Prior to 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.32.0.
CVSS v3.1
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Microsoft Kiota is an OpenAPI-based HTTP client code generator. In versions before 1.32.0, the Ruby code generator improperly handles schema-derived strings by embedding them into double-quoted Ruby literals without escaping interpolation markers. This improper control of code generation (CWE-94) allows an attacker to inject arbitrary Ruby code via crafted OpenAPI inputs containing #{expr}, #$var, or #@var sequences. The vulnerability is resolved in version 1.32.0.
Potential Impact
An attacker who can influence OpenAPI schema inputs used by Kiota's Ruby generator can inject arbitrary Ruby code into generated model classes. This can lead to execution of malicious code when the generated code is run. The CVSS score is 7.5 (high), indicating significant impact primarily on availability (denial of service) but potentially also on integrity or other aspects depending on usage.
Mitigation Recommendations
Upgrade to Kiota version 1.32.0 or later, where this code injection vulnerability is fixed by properly escaping interpolation markers in Ruby code generation. No other official remediation or temporary fixes are indicated. Patch status is confirmed fixed in 1.32.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-07T15:41:53.606Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a58ef3568715ace4330614c
Added to database: 07/16/2026, 14:48:21 UTC
Last enriched: 07/31/2026, 12:29:44 UTC
Last updated: 08/16/2026, 12:41:10 UTC
Views: 76
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.