{"id":"CVE-2026-59859","published":"2026-07-16T14:40:27Z","modified":"2026-08-17T15:02:29Z","title":"Kiota: Code Generation Literal Injection in the PHP 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.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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.7,"severity":"HIGH","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01381,"percentile":0.72818,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/microsoft/kiota/security/advisories/GHSA-jqwh-526h-c92j","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/microsoft/kiota/pull/7863","tags":["x_refsource_MISC"]},{"url":"https://github.com/microsoft/kiota/commit/5e2a211ac4261988fbdc72c3b268596ea8837b87","tags":["x_refsource_MISC"]},{"url":"https://github.com/microsoft/kiota/releases/tag/v1.32.4","tags":["x_refsource_MISC"]}],"priority":{"score":20.7,"factors":[{"name":"EPSS percentile","points":14.56},{"name":"CVSS severity","points":6.09}]},"vendorSlug":"microsoft","affectedVersions":[{"vendor":"microsoft","product":"kiota","versions":[">= 1.30.0, < 1.31.1","< 1.29.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-07-17T03:56:37.664979Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"NuGet","package":"Microsoft.OpenApi.Kiota","vulnerableRanges":[">=1.30.0, <1.32.4","<1.29.1"],"patched":["1.32.4","1.29.1"],"from":["GHSA-jqwh-526h-c92j"],"provenance":"source"},{"ecosystem":"NuGet","package":"Microsoft.OpenApi.Kiota.Builder","vulnerableRanges":[">=1.30.0, <1.32.4","<1.29.1"],"patched":["1.32.4","1.29.1"],"from":["GHSA-jqwh-526h-c92j"],"provenance":"source"}],"summary":{"text":"Kiota's PHP code generator, in versions before 1.29.1 and 1.32.4, fails to escape dollar signs when it places OpenAPI schema-derived strings such as descriptions, default values, and property names into PHP double-quoted literals, so generated model and request-builder classes can contain injected PHP code. An attacker who can supply a crafted OpenAPI description, which requires user interaction to have the generator process it, can get that code executed in the generated classes.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:12:51Z"},"euvd":{"id":"EUVD-2026-44928","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-microsoft-kiota-cve-2026-59859","children":[{"from":"CVE-2026-59859","to":"CVE-2026-105796","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/Kiota.Builder/Writers/Php/PhpConventionService.cs"],"commits":["https://github.com/microsoft/kiota/commit/68f33b865be9273464a6efbbe17379760e51f1a4","https://github.com/microsoft/kiota/commit/5e2a211ac4261988fbdc72c3b268596ea8837b87"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2026-41134","published":"2026-04-22","fixed":"1.31.1","kev":false},{"cve":"CVE-2026-59860","published":"2026-07-16","fixed":"1.32.3","kev":false,"link":{"from":"CVE-2026-59860","to":"CVE-2026-59859","relation":"successor","confidence":"low","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"NuGet:Microsoft.OpenApi.Kiota","fromFixed":"1.32.3","toFixed":"1.32.4","daysApart":0},{"kind":"version-step","provenance":"source","package":"NuGet:Microsoft.OpenApi.Kiota.Builder","fromFixed":"1.32.3","toFixed":"1.32.4","daysApart":0}]}},{"cve":"CVE-2026-59859","published":"2026-07-16","fixed":"1.32.4","kev":false},{"cve":"CVE-2026-59863","published":"2026-07-16","fixed":"1.32.5","kev":false},{"cve":"CVE-2026-59864","published":"2026-07-16","fixed":"1.32.5","kev":false},{"cve":"CVE-2026-59865","published":"2026-07-16","fixed":"1.32.5","kev":false}],"package":"NuGet:Microsoft.OpenApi.Kiota"}}