Skip to main content

Microsoft Kiota CVE-2026-41134

| EUVDEUVD-2026-25094 HIGH
Code Injection (CWE-94)
2026-04-22 GitHub_M GHSA-2hx3-vp6r-mg3f
7.3
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 malicious OpenAPI file
  2. Delivery
    Developer downloads tampered specification
  3. Exploit
    Kiota generates poisoned client code
  4. Execution
    Developer compiles injected code
  5. Persist
    Application executes attacker payload
  6. Impact
    Credential theft or persistence

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 developers to generate Kiota clients from OpenAPI descriptions originating from untrusted sources or legitimate sources that have been compromised via supply chain attack. The vulnerability does NOT affect runtime behavior of existing applications unless developers explicitly regenerate clients using vulnerable Kiota versions against malicious specifications. Attack prerequisites: attacker must craft a malicious OpenAPI document with injection payloads in metadata fields processed by Kiota's literal emission code paths (enum values, property names, default values, serialization keys); victim developer must obtain this malicious specification (via public repository, compromised vendor site, or man-in-the-middle attack); victim must run Kiota version prior to 1.31.1 against the malicious file; victim must compile the generated code and deploy it to production. User interaction (UI:P) and attack timing (AT:P) substantially limit exploitation - developers must actively choose to generate from the malicious source. Organizations generating clients exclusively from internally developed or cryptographically verified vendor OpenAPI specifications are not realistically at risk. The local attack vector (AV:L) indicates this is fundamentally a developer workstation or CI/CD pipeline compromise rather than a network-exploitable server vulnerability.

Impact

Real-world risk requires supply chain compromise or developer error rather than direct network exploitation. The CVSS vector (AV:L/AC:L/AT:P/PR:N/UI:P) reveals critical limiting factors: local attack vector means the attacker must deliver a malicious OpenAPI file to the victim developer, user interaction is required (developer must explicitly run Kiota generation), and attack timing is present (victim must compile and deploy the poisoned client). This is NOT a remotely exploitable vulnerability in deployed applications - it targets the software development process itself. The high confidentiality/integrity/availability impacts (VC:H/VI:H/VA:H) reflect consequences AFTER successful exploitation: arbitrary code in generated clients can access credentials, modify data, and disrupt services. No KEV listing and no public POC suggest exploitation has not occurred at scale. Primary risk scenarios: compromised public API repositories, man-in-the-middle attacks on OpenAPI downloads, or insider threats planting backdoors via malicious API definitions. Organizations generating clients only from vendor-signed, integrity-verified OpenAPI descriptions face minimal practical risk. The vulnerability severity is architectural (supply chain poisoning) rather than operational (network attack surface).

Exploit ScenarioDerived

An attacker publishes a malicious OpenAPI specification to a public API repository or compromises a legitimate API vendor's specification file. A developer discovers this API, downloads the OpenAPI description, and runs Kiota to generate a client library for their application. The malicious specification contains crafted enum values or property names with embedded code injection sequences such as escape characters and language-specific syntax. Kiota processes these values without proper escaping, emitting them directly into generated source files. The developer compiles the generated client, unknowingly including the attacker's injected code. When the application runs, the injected code executes with the application's privileges, potentially exfiltrating environment variables, API keys, or establishing persistence. If public exploit code becomes available demonstrating specific injection payloads for different language targets, exploitation complexity drops significantly.

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

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

Alert me

AnalysisAIv1 – Apr 23, 2026

Code injection in Microsoft Kiota versions prior to 1.31.1 allows attackers who control or tamper with OpenAPI descriptions to inject malicious code into generated HTTP client libraries. Exploitation requires developers to generate clients from untrusted or compromised OpenAPI specifications, then compile and execute the poisoned code. The attack chain culminates in arbitrary code execution within the context of applications using the tainted generated clients. CVSS 7.3 with local attack vector and user interaction required suggests lower immediate urgency, though EPSS data is unavailable. No public exploit code or active exploitation confirmed at time of analysis.

RemediationAI

Upgrade Kiota to version 1.31.1 or later from the official GitHub releases at github.com/microsoft/kiota/releases or via package managers (NuGet for .NET, npm for TypeScript tooling). After upgrading the generator, regenerate all existing HTTP client libraries as previously generated code may contain vulnerable output from earlier Kiota versions - the upgrade alone does not remediate deployed clients. Review OpenAPI description sources and implement integrity verification: download specifications over HTTPS with certificate validation, verify cryptographic signatures from API vendors when available, and maintain an allowlist of trusted API description repositories. As a compensating control until upgrade, restrict Kiota generation to a sandboxed environment separate from production development systems, and perform code review and static analysis on all generated client code before integration - though this is labor-intensive and error-prone compared to upgrading. Avoid generating clients from user-submitted or externally contributed OpenAPI files without thorough manual security review. For air-gapped environments where immediate upgrade is infeasible, implement process controls requiring security team approval before introducing new generated clients into the build pipeline.

Affected VersionsENISA

kiota < 1.31.1

Affected Packages

nuget kiota fix: 1.31.1
nuget microsoft.openapi.kiota fix: 1.29.1, 1.31.1
nuget microsoft.openapi.kiota.builder fix: 1.29.1, 1.31.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in nuget

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 code generator that produces strongly-typed HTTP client libraries from API specifications. The vulnerability stems from insufficient output encoding when emitting literal values from OpenAPI documents into generated source code. CWE-94 (Improper Control of Generation of Code) indicates the root cause: user-controlled data from OpenAPI fields (property names, enum values, default values, path parameters, serialization keys) is incorporated into code templates without context-aware escaping. Attackers can embed string-breaking sequences and code fragments in malicious OpenAPI descriptions. When developers run Kiota against such descriptions, the generator produces source files containing injected code. The CPE string cpe:2.3:a:microsoft:kiota identifies all Kiota versions below 1.31.1 as vulnerable across multiple language output targets (C#, TypeScript, Java, Python, Go, PHP, Swift).

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 7.3 HIGH
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M) · only source for this CVE.

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
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

4
Patch available
Apr 22, 2026 - 22:02 EUVD
Patch released
Apr 22, 2026 - 21:23 nvd
Patch available
CVSS changed
Apr 22, 2026 - 21:22 NVD
7.3 (HIGH)
CVE Published
Apr 22, 2026 - 20:20 nvd
HIGH 7.3

DescriptionCVE.org

Kiota is an OpenAPI based HTTP Client code generator. Versions prior to 1.31.1 are affected by a code-generation literal injection vulnerability in multiple writer sinks (for example: serialization/deserialization keys, path/query parameter mappings, URL template metadata, enum/property metadata, and default value emission). When malicious values from an OpenAPI description are emitted into generated source without context-appropriate escaping, an attacker can break out of string literals and inject additional code into generated clients. This issue is only practically exploitable when the OpenAPI description used for generation is from an untrusted source, or a normally trusted OpenAPI description has been compromised/tampered with. Only generating from trusted, integrity-protected API descriptions significantly reduces the risk. To remediate the issue, upgrade Kiota to 1.31.1 or later and regenerate/refresh existing generated clients as a precaution. Refreshing generated clients ensures previously generated vulnerable code is replaced with hardened output.

Executive ViewAI

Why It Matters

Microsoft Kiota versions before 1.31.1 contain a code injection vulnerability that allows attackers to embed malicious code into auto-generated HTTP client libraries if developers use compromised OpenAPI specifications. This poses significant risk to development teams and downstream applications that consume these poisoned libraries, potentially enabling arbitrary code execution in production environments.

Business Impact: High
Compensating Controls

Vendor-released patch: version 1.31.1 or later. Until patched, restrict OpenAPI client generation to internally-controlled specifications only, disable automated or third-party OpenAPI ingestion, and implement code review processes for all generated client libraries before deployment.

Threat Intelligence Overview

EPSS Score
0.1%
Top 84% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA 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 0.1%
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
Small
Automatable
Yes
Human Impact
High
Technical Impact
Total

Priority Score

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

Attack Technique

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

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-59859 HIGH
8.7 Jul 16

PHP code generation in Microsoft Kiota prior to 1.32.4 permits injection of arbitrary PHP code when the generator proces

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