Kiota: Code Generation Literal Injection in Kiota Ruby Generator
microsoft kiota
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Microsoft.OpenAPI.Kiota NuGet |
|
|
| Microsoft.OpenAPI.Kiota.Builder NuGet |
|
|
| Microsoft.OpenApi.Kiota |
microsoft kiota
| Product | Affected | Fixed in |
|---|---|---|
| Microsoft.OpenAPI.Kiota NuGet |
|
|
| Microsoft.OpenAPI.Kiota.Builder NuGet |
|
|
| Microsoft.OpenApi.Kiota |
|
|
| Microsoft.OpenApi.Kiota.Builder NuGet |
|
|
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.
From the CVE record · GitHub_M
Kiota's Ruby generator does not escape interpolation markers in schema-derived strings placed in double-quoted literals. An attacker who controls OpenAPI schema content can inject Ruby code into generated model classes; the input does not specify network access, authentication, or user-interaction requirements.
Check users of the NuGet packages Microsoft.OpenAPI.Kiota and Microsoft.OpenAPI.Kiota.Builder at versions >=1.30.0 and <1.32.0, and Microsoft.OpenApi.Kiota and Microsoft.OpenApi.Kiota.Builder at versions <1.29.1.