CVE-2026-59859: 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.4, Kiota's PHP generator embedded OpenAPI description, default fields, property names, and other schema-derived strings into PHP double-quoted literals through SanitizeDoubleQuote() in Writers/StringExtensions.cs without escaping $, allowing attacker-controlled ${...}, $var, or {$obj->prop} interpolation constructs to inject arbitrary PHP code into generated model and request-builder classes. This issue is fixed in version 1.32.4.
AI Analysis
Technical Summary
Microsoft Kiota versions before 1.32.4 contain a code injection vulnerability (CWE-94) in the PHP generator component. The vulnerability arises because the SanitizeDoubleQuote() function in Writers/StringExtensions.cs does not escape the $ character when embedding OpenAPI description fields and schema-derived strings into PHP double-quoted literals. This omission allows an attacker to craft malicious OpenAPI specifications that include interpolation constructs (${...}, $var, {$obj->prop}) which get injected as executable PHP code in the generated client code. This could lead to arbitrary code execution when the generated PHP code is run. The vulnerability is resolved in Kiota version 1.32.4.
Potential Impact
An attacker who can influence the OpenAPI description or schema inputs used by Kiota's PHP generator can inject arbitrary PHP code into the generated client code. This could lead to remote code execution when the generated code is executed, posing a significant security risk. The CVSS 4.0 base score is 8.7 (high), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high impacts on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade to Kiota version 1.32.4 or later, where this vulnerability is fixed by properly escaping the $ character in PHP double-quoted literals. No other mitigation is indicated or required as the fix is available.
CVE-2026-59859: 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.4, Kiota's PHP generator embedded OpenAPI description, default fields, property names, and other schema-derived strings into PHP double-quoted literals through SanitizeDoubleQuote() in Writers/StringExtensions.cs without escaping $, allowing attacker-controlled ${...}, $var, or {$obj->prop} interpolation constructs to inject arbitrary PHP code into generated model and request-builder classes. This issue is fixed in version 1.32.4.
CVSS v4.0
Score 8.7high
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 versions before 1.32.4 contain a code injection vulnerability (CWE-94) in the PHP generator component. The vulnerability arises because the SanitizeDoubleQuote() function in Writers/StringExtensions.cs does not escape the $ character when embedding OpenAPI description fields and schema-derived strings into PHP double-quoted literals. This omission allows an attacker to craft malicious OpenAPI specifications that include interpolation constructs (${...}, $var, {$obj->prop}) which get injected as executable PHP code in the generated client code. This could lead to arbitrary code execution when the generated PHP code is run. The vulnerability is resolved in Kiota version 1.32.4.
Potential Impact
An attacker who can influence the OpenAPI description or schema inputs used by Kiota's PHP generator can inject arbitrary PHP code into the generated client code. This could lead to remote code execution when the generated code is executed, posing a significant security risk. The CVSS 4.0 base score is 8.7 (high), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high impacts on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade to Kiota version 1.32.4 or later, where this vulnerability is fixed by properly escaping the $ character in PHP double-quoted literals. No other mitigation is indicated or required as the fix is available.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-07T15:41:53.606Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a58ef3568715ace43306131
Added to database: 07/16/2026, 14:48:21 UTC
Last enriched: 07/31/2026, 12:30:54 UTC
Last updated: 08/16/2026, 13:11:20 UTC
Views: 80
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.