Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker crafts malicious OpenAPI file
-
DeliveryDeveloper downloads tampered specification
-
ExploitKiota generates poisoned client code
-
ExecutionDeveloper compiles injected code
-
PersistApplication executes attacker payload
-
ImpactCredential 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
Lifecycle Timeline
4DescriptionCVE.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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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 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.
Command injection in Microsoft Kiota before 1.32.5 lets a malicious or compromised OpenAPI description dictate the insta
Path traversal and code injection in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description write
Path traversal in Microsoft Kiota before 1.32.5 lets an attacker-controlled OpenAPI description inject unvalidated `stat
Code injection in Microsoft Kiota 0.5.0 through pre-1.35.0 allows attacker-controlled text embedded in an OpenAPI descri
PHP code generation in Microsoft Kiota prior to 1.32.4 permits injection of arbitrary PHP code when the generator proces
Code-generation injection in Microsoft Kiota's C# XML documentation-comment writer allows an attacker who controls or co
Code injection in Microsoft Kiota Ruby code generator allows remote code execution through crafted OpenAPI specification
Code injection in Microsoft Kiota's Python client generator (versions prior to 1.32.0) allows an attacker who controls a
Build-time SSRF, remote file inclusion, and local file inclusion in Microsoft Kiota before 1.32.5 lets an attacker-contr
Arbitrary file write via path traversal in Microsoft Kiota (OpenAPI HTTP client/plugin code generator) before 1.32.5 all
Microsoft Kiota, the OpenAPI-based HTTP client code generator, fails to validate the x-ai-capabilities.response_semantic
EUVD-2026-25094
GHSA-2hx3-vp6r-mg3f
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB