Description
Kiota is an OpenAPI based HTTP Client code generator. Prior to 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.32.4.
Published: 2026-07-16
Score: 8.7 High
EPSS: 1.0% Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a code generation literal injection identified as CWE‑94 in Kiota's PHP generator. Prior to 1.32.4, the generator inserted OpenAPI schema strings directly into double‑quoted PHP literals without escaping dollar signs. Based on the description, it is inferred that an attacker supplies a crafted OpenAPI specification that the generator processes, allowing PHP interpolation constructs such as ${…}, $var, or {$obj->prop} to be injected into the generated code and executed. Consequently, the injected PHP code runs within the environment that loads or executes the generated classes, leading to remote code execution.

Affected Systems

Affected vendors and products: Microsoft Kiota, the OpenAPI‑based HTTP client code generator. Versions older than 1.32.4 are vulnerable. The fix is included in Kiota release 1.32.4 and subsequent versions; therefore, any installation of Kiota < 1.32.4 that processes potentially untrusted OpenAPI definitions is impacted.

Risk and Exploitability

The likely attack vector is an attacker supplying a crafted OpenAPI specification to the PHP generator. Based on the description, it is inferred that this allows the injection of PHP interpolation constructs into double‑quoted literals, leading to arbitrary code execution. Risk assessment shows a CVSS score of 8.7, indicating high severity. The EPSS score is 1%, suggesting a very low but nonzero exploitation probability, and the vulnerability is not listed in CISA's KEV catalog. Attack requires the generator to process untrusted OpenAPI definitions, which is typically a developer‑level or local effect, but can also be leveraged in automated build pipelines that consume untrusted specs. If not mitigated, the impact would be code execution on the environment where the generated PHP code runs. Therefore, organizations should consider the risk high when the generator is used in production environments.

Generated by OpenCVE AI on July 31, 2026 at 01:54 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Kiota to version 1.32.4 or later to apply the vendor patch that escapes dollar signs in generated literals.
  • Ensure that any OpenAPI specifications fed into the generator originate from trusted sources; perform input validation or restrict the generator to trusted environments to prevent injection.
  • If an upgrade is not immediately feasible, conduct a manual review or strip dollar signs from generated strings, or use a custom sanitization layer that escapes interpolation sequences before code generation.

Generated by OpenCVE AI on July 31, 2026 at 01:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-jqwh-526h-c92j Microsoft Kiota: Code Generation Literal Injection in Kiota PHP Generator
History

Wed, 29 Jul 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 16 Jul 2026 15:45:00 +0000

Type Values Removed Values Added
First Time appeared Microsoft
Microsoft kiota
Vendors & Products Microsoft
Microsoft kiota

Thu, 16 Jul 2026 14:45:00 +0000

Type Values Removed Values Added
Description Kiota is an OpenAPI based HTTP Client code generator. Prior to 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.32.4.
Title Kiota: Code Generation Literal Injection in the PHP Generator
Weaknesses CWE-94
References
Metrics cvssV4_0

{'score': 8.7, '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-29T18:29:05.321Z

Reserved: 2026-07-07T15:41:53.606Z

Link: CVE-2026-59859

cve-icon Vulnrichment

Updated: 2026-07-29T18:29:01.194Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T02:00:05Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')