Advisory Database
  • Advisories
  • Dependency Scanning
  1. nuget
  2. ›
  3. Microsoft.OpenApi.Kiota
  4. ›
  5. CVE-2026-59862

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

July 24, 2026

Code Generation Literal Injection in Kiota Python Generator Leads to Arbitrary Code Execution at Import Time.

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

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

References

  • github.com/advisories/GHSA-7f3j-j7jj-r3vr
  • github.com/microsoft/kiota/releases/tag/v1.32.0
  • github.com/microsoft/kiota/security/advisories/GHSA-7f3j-j7jj-r3vr
  • nvd.nist.gov/vuln/detail/CVE-2026-59862

Code Behaviors & Features

Detect and mitigate CVE-2026-59862 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.32.0

Fixed versions

  • 1.32.0

Solution

Upgrade to version 1.32.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

nuget/Microsoft.OpenApi.Kiota/CVE-2026-59862.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:18:14 +0000.