{"id":"CVE-2026-59861","published":"2026-07-16T14:36:32Z","modified":"2026-08-17T15:02:02Z","title":"Kiota: Code Generation Literal Injection in Kiota Ruby Generator","vendor":"Microsoft","product":"kiota","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.02048,"percentile":0.81691,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/microsoft/kiota/security/advisories/GHSA-xg2h-5xr2-29jw","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/microsoft/kiota/pull/7746","tags":["x_refsource_MISC"]},{"url":"https://github.com/microsoft/kiota/commit/fee1b648bb4394ba7ba72de9c0ce4f2a0bad0cb6","tags":["x_refsource_MISC"]},{"url":"https://github.com/microsoft/kiota/releases/tag/v1.32.0","tags":["x_refsource_MISC"]}],"priority":{"score":21.6,"factors":[{"name":"EPSS percentile","points":16.34},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"microsoft","affectedVersions":[{"vendor":"microsoft","product":"kiota","versions":[">= 1.30.0, < 1.31.1","< 1.29.1"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2026-07-17T03:56:35.781411Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"NuGet","package":"Microsoft.OpenAPI.Kiota","vulnerableRanges":[">=1.30.0, <1.32.0","<1.29.1"],"patched":["1.32.0","1.29.1"],"from":["GHSA-xg2h-5xr2-29jw"],"provenance":"source"},{"ecosystem":"NuGet","package":"Microsoft.OpenAPI.Kiota.Builder","vulnerableRanges":[">=1.30.0, <1.32.0","<1.29.1"],"patched":["1.32.0","1.29.1"],"from":["GHSA-xg2h-5xr2-29jw"],"provenance":"source"}],"summary":{"text":"Kiota's Ruby code generator (the Kiota tool itself) fails to escape \"#\" when it writes OpenAPI-derived default values, property names, and other schema strings into Ruby double-quoted literals in generated model classes. An attacker who can influence the OpenAPI schema that Kiota consumes can embed Ruby interpolation markers that get executed as code in the generated classes, with no authentication or user interaction required beyond the generation step itself.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:03:33Z"},"euvd":{"id":"EUVD-2026-44926","exploited":false,"provenance":"source"}}