Kiota: Code Generation Literal Injection in the PHP Generator
microsoft kiota
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Microsoft.OpenApi.Kiota NuGet |
|
|
| Microsoft.OpenApi.Kiota.Builder NuGet |
|
microsoft kiota
| Product | Affected | Fixed in |
|---|---|---|
| Microsoft.OpenApi.Kiota NuGet |
|
|
| Microsoft.OpenApi.Kiota.Builder NuGet |
|
|
Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 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.29.1 and 1.32.4.
From the CVE record · GitHub_M
Kiota’s PHP generator does not escape dollar signs in schema-derived strings before placing them in PHP double-quoted literals. An attacker who controls strings in an OpenAPI description can inject PHP code into generated model and request-builder classes. The input does not specify authentication or user-interaction requirements.
Teams using the NuGet packages Microsoft.OpenApi.Kiota or Microsoft.OpenApi.Kiota.Builder in versions earlier than 1.29.1 or from 1.30.0 up to but not including 1.32.4 should check their deployments.