{"id":"GHSA-7f3j-j7jj-r3vr","revision":null,"records":[{"revision":"0396df07bc884d1db24b9c4c60b132f8","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-59862","aliases":[],"title":"Kiota: Code Generation Literal Injection in the Python Generator","description":"Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.0, Kiota's Python generator let attacker-controlled enum value descriptions from x-ms-enum.values[].description flow through KiotaBuilder.SetEnumOptions into Documentation.DescriptionTemplate and PythonConventionService.RemoveInvalidDescriptionCharacters without newline sanitization, allowing generated inline comments to split and execute attacker-controlled Python code at module scope when generated modules were imported. This issue is fixed in version 1.29.1 and 1.32.0.","state":0,"publishedAt":"2026-07-16T14:38:59.471+00:00","modifiedAt":"2026-08-17T15:02:15.729+00:00","affected":[{"ecosystem":"Vendor product","name":"kiota","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"microsoft\",\n                    \"product\": \"kiota\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 1.30.0, < 1.31.1\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"< 1.29.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/microsoft/kiota/security/advisories/GHSA-7f3j-j7jj-r3vr","https://github.com/microsoft/kiota/releases/tag/v1.32.0"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-59862","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-59862","identifiers":["CVE-2026-59862"]},"retained":false,"historicalAffected":[]},{"revision":"e2a3976587454df3b57989a34875fd93","observedAt":"2026-10-25T14:19:22.811+00:00","statement":{"source":"nvd","id":"CVE-2026-59862","aliases":[],"title":"Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.0, Kiota's Python generator let attacker-controlled enum value descriptions from x-ms-enum.values[].description flow through KiotaBuilder.SetEnumOptions into Doc…","description":"Kiota is an OpenAPI based HTTP Client code generator. Prior to 1.29.1 and 1.32.0, Kiota's Python generator let attacker-controlled enum value descriptions from x-ms-enum.values[].description flow through KiotaBuilder.SetEnumOptions into Documentation.DescriptionTemplate and PythonConventionService.RemoveInvalidDescriptionCharacters without newline sanitization, allowing generated inline comments to split and execute attacker-controlled Python code at module scope when generated modules were imported. This issue is fixed in version 1.29.1 and 1.32.0.","state":0,"publishedAt":"2026-07-16T15:16:35.57+00:00","modifiedAt":"2026-10-24T20:10:00.137+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/microsoft/kiota/releases/tag/v1.32.0","https://github.com/microsoft/kiota/security/advisories/GHSA-7f3j-j7jj-r3vr"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-59862","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-94"],"productCriteria":[],"sourceDates":{"published":"2026-07-16T15:16:35.570","lastModified":"2026-10-24T20:10:00.137"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-59862","identifiers":["CVE-2026-59862"]},"retained":false,"historicalAffected":[]},{"revision":"c773cde22f9a4dd7aa802a4f429e0f8c","observedAt":"2026-10-23T16:01:25.029+00:00","statement":{"source":"osv","id":"GHSA-7f3j-j7jj-r3vr","aliases":["CVE-2026-59862"],"title":"Microsoft Kiota: Code Generation Literal Injection in Kiota Python Generator","description":"Code Generation Literal Injection in Kiota Python Generator Leads to Arbitrary Code Execution at Import Time.\n\nThe Kiota Python code generator is vulnerable to a code generation literal injection issue when processing malicious or untrusted OpenAPI specifications. Specifically, attacker-controlled enum value descriptions from x-ms-enum.values[].description can flow into generated Python files without newline sanitization, allowing injected content to escape a comment context and execute at module scope when the generated module is imported.\n\nThis issue requires user interaction in the form of generating a client from a malicious specification and importing the generated code, which is a common development and CI workflow.\n\n# Impact\n\nA malicious OpenAPI specification can cause arbitrary Python code to be emitted into generated model files. The payload executes when the affected module is imported.\n\n## Potential impact includes\n\nCredential theft from developer or CI environments\nExfiltration of environment variables and secrets\nSource code disclosure\nPersistence via regenerated backdoored client output\nWho is impacted\nDevelopers generating Python SDKs from external or untrusted OpenAPI specs\nTeams with CI/CD automation that regenerates clients from remote specification URLs\nAny environment importing generated Python modules before manual review\nVulnerability details\nTwo gaps combine to enable exploitation:\n\n### Enum description cleanup gap\n\nIn KiotaBuilder.SetEnumOptions, enum option descriptions are assigned to Documentation.DescriptionTemplate without CleanupDescription on this path, allowing control characters such as newlines to propagate.\n\n### Python description sanitization gap\n\nPythonConventionService.RemoveInvalidDescriptionCharacters escapes backslashes and triple quotes but did not remove carriage return/newline characters, unlike some other language convention services.\n\n# Exploit path\n\nMalicious newline in x-ms-enum description is emitted through enum writing path.\nGenerated inline comment output is split by newline.\nSubsequent attacker-controlled line lands at module scope in generated .py file.\nImporting the module executes the injected code.\n\n# Attack vectors\n\nOpenAPI specifications hosted at attacker-controlled URLs\nSupply-chain scenarios where third-party specs are consumed automatically\nCI pipelines that generate and then import or test generated Python clients\n\n# Patches\n\nhttps://github.com/microsoft/kiota/pull/7735\n\n# Workarounds\n\nIf you cannot upgrade immediately:\n\nOnly generate from trusted, internally controlled OpenAPI specification sources.\nDisable or gate automatic generation from remote specs in CI/CD.\nAdd validation/sanitization for x-ms-enum descriptions before generation.\nReview generated Python files for suspicious top-level statements near enum/model declarations.\nRun generation and validation in isolated environments without access to production secrets.\n\n# Remediation\n\nUpgrade to Kiota 1.29.1, 1.32.0, or later.\n\nRegenerate existing Python clients to replace previously generated vulnerable output.\n\n# Recommended validation after upgrade\n\nRegenerate from the same spec used in proof-of-concept testing\nConfirm malicious multi-line enum descriptions no longer produce executable top-level output","state":0,"publishedAt":"2026-07-24T15:45:40+00:00","modifiedAt":"2026-08-17T15:00:08.1102713+00:00","affected":[{"ecosystem":"NuGet","name":"Microsoft.OpenAPI.Kiota","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"1.30.0"},{"kind":"fixed","version":"1.32.0"}]}],"versions":["1.30.0","1.31.0","1.31.1"],"rawVersionEvidence":null},{"ecosystem":"NuGet","name":"Microsoft.OpenAPI.Kiota.Builder","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"1.30.0"},{"kind":"fixed","version":"1.32.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"NuGet","name":"Microsoft.OpenApi.Kiota","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.29.1"}]}],"versions":["0.1.0-preview","0.1.1-preview","0.1.2-preview","0.1.3-preview","0.10.0-preview","0.11.0-preview","0.11.1-preview","0.2.0-preview","0.2.1-preview","0.3.0-preview","0.4.0-preview","0.5.0-preview","0.5.1-preview","0.6.0-preview","0.7.1-preview","0.8.3-preview","0.9.0-preview","1.0.0","1.0.1","1.1.0","1.1.1","1.1.2","1.1.3","1.10.0","1.10.1","1.11.0","1.11.1","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0","1.18.0","1.19.0","1.19.1","1.2.0","1.2.1","1.20.0","1.21.0","1.22.0","1.22.1","1.22.2","1.22.3","1.23.0","1.24.0","1.24.1","1.24.2","1.24.3","1.25.1","1.26.0","1.26.1","1.27.0","1.28.0","1.29.0","1.3.0","1.4.0","1.5.0","1.5.1","1.6.1","1.7.0","1.8.0","1.8.1","1.8.2","1.9.0","1.9.1"],"rawVersionEvidence":null},{"ecosystem":"NuGet","name":"Microsoft.OpenApi.Kiota.Builder","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.29.1"}]}],"versions":["0.2.0-preview","0.3.0-preview","0.4.0-preview","0.5.0-preview","0.5.1-preview","0.6.0-preview","0.7.1-preview","1.0.0","1.0.1","1.1.0","1.1.1","1.1.2","1.1.3","1.10.0","1.10.1","1.11.0","1.11.1","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0","1.18.0","1.19.0","1.19.1","1.2.0","1.2.1","1.20.0","1.21.0","1.22.0","1.22.1","1.22.2","1.22.3","1.23.0","1.3.0","1.4.0","1.5.0","1.5.1","1.6.1","1.7.0","1.8.0","1.8.1","1.8.2","1.9.0","1.9.1"],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/microsoft/kiota/security/advisories/GHSA-7f3j-j7jj-r3vr","https://nvd.nist.gov/vuln/detail/CVE-2026-59862","https://github.com/microsoft/kiota","https://github.com/microsoft/kiota/releases/tag/v1.32.0"],"sourceUrl":"https://github.com/advisories/GHSA-7f3j-j7jj-r3vr","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-7f3j-j7jj-r3vr","identifiers":["GHSA-7f3j-j7jj-r3vr","CVE-2026-59862"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-27T06:23:11.1755366+00:00","complete":true,"records":1758,"lastAttemptAt":"2026-10-27T06:23:11.1755366+00:00","lastSuccessAt":"2026-10-27T06:23:11.3565583+00:00","error":null,"lastVerifiedAt":"2026-10-27T06:23:11.3565593+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-187d2b72c94ceb8c4417f1032ec3109a3a3a7b730abadb561d8cdd2a96e04d27-d89028bfe484b9f2f1584c390248bf5d4aaf0d2d77cee1f0194aa28f589e2a1c","complete":true,"records":414861,"lastAttemptAt":"2026-10-27T06:23:10.0360294+00:00","lastSuccessAt":"2026-10-27T06:23:10.0059652+00:00","error":null,"lastVerifiedAt":"2026-10-27T06:23:10.0360294+00:00","snapshotPublishedAt":"2026-10-27T05:33:36+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-43321610382942b8ad8c85917eab1546","complete":false,"records":4735,"lastAttemptAt":"2026-10-27T06:23:43.0819677+00:00","lastSuccessAt":"2026-10-24T23:18:49.862+00:00","error":"InvalidDataException","lastVerifiedAt":"2026-10-24T23:18:49.862+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":0,"expectedIdentifiers":13477},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-27T06:23:11.1755366+00:00","complete":true,"records":1093,"lastAttemptAt":"2026-10-27T06:23:11.1755366+00:00","lastSuccessAt":"2026-10-27T06:23:11.3582007+00:00","error":null,"lastVerifiedAt":"2026-10-27T06:23:11.358201+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-aabec971d7d04375928662238d3061aa","complete":false,"records":13416,"lastAttemptAt":"2026-10-27T06:23:41.1678372+00:00","lastSuccessAt":"2026-10-27T06:23:41.164+00:00","error":null,"lastVerifiedAt":"2026-10-27T06:23:41.164+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13077,"expectedIdentifiers":13477},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-c3121b113ecd88f1c92ccfa0ec9757ddc8386e4c12afd2597450b815744f800a","complete":true,"records":9779,"lastAttemptAt":"2026-10-27T06:23:10.673414+00:00","lastSuccessAt":"2026-10-26T15:37:14.3083004+00:00","error":null,"lastVerifiedAt":"2026-10-27T06:23:10.673414+00:00","snapshotPublishedAt":"2026-10-26T14:48:41+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-bad5d31e7f6a5e3d338e11d8789069b63620a403f927730769688b42f768e4f6","complete":true,"records":1965,"lastAttemptAt":"2026-10-27T06:23:10.0870813+00:00","lastSuccessAt":"2026-10-26T16:35:43.1460623+00:00","error":null,"lastVerifiedAt":"2026-10-27T06:23:10.0870813+00:00","snapshotPublishedAt":"2026-10-26T16:18:29+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-a393d8fe0ae8408f3e4cab413b76047090c8e4a3c0a186c79edf33c9a3d3af95","complete":true,"records":2995,"lastAttemptAt":"2026-10-27T06:23:11.0608384+00:00","lastSuccessAt":"2026-10-26T14:35:47.9640893+00:00","error":null,"lastVerifiedAt":"2026-10-27T06:23:11.0608384+00:00","snapshotPublishedAt":"2026-10-26T14:18:55+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-2c2579bb03487537529e2b647fd2d9950cfc0fec1a9832dba33e322b8dcbe369","complete":true,"records":230812,"lastAttemptAt":"2026-10-27T06:23:10.5680382+00:00","lastSuccessAt":"2026-10-26T21:37:26.5810298+00:00","error":null,"lastVerifiedAt":"2026-10-27T06:23:10.5680382+00:00","snapshotPublishedAt":"2026-10-26T21:33:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null}]}