CVE-2026-41134 — Microsoft.OpenApi.Kiota
CVE-2026-41134 is a Code Injection vulnerability in Microsoft.OpenApi.Kiota. A fix is available for Microsoft.OpenApi.Kiota — see the affected versions and patch details below.
Kiota: Code Generation Literal Injection
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-41134.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
Microsoft.OpenApi.Kiota.NETMicrosoft.OpenApi.Kiota.Builder.NETMicrosoft.OpenApi.Kiota.NETMicrosoft.OpenApi.Kiota.BuilderReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects NuGet packages — download data is not available via public APIs for these ecosystems.
Description
CVE Advisory (CVE-2026-41134): Code Generation Literal Injection in Kiota
Summary
Kiota versions prior to 1.29.1 and 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.
Impact and Preconditions
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.
If you only generate from trusted, integrity-protected API descriptions, risk is significantly reduced.
Affected Versions
- Affected: all versions < 1.29.1 and >= 1.30.0, < 1.31.1
- Fixed: 1.29.1, 1.31.1, and later
Illustrative Exploit Example
Example OpenAPI fragment (malicious default value)
openapi: 3.0.1
info:
title: Exploit Demo
version: 1.0.0
components:
schemas:
User:
type: object
properties:
displayName:
type: string
default: "\"; throw new System.Exception(\"injected\"); //"
Example generated C# snippet before fix (illustrative)
public User() {
DisplayName = ""; throw new System.Exception("injected"); //";
}
The injected payload escapes the intended string context and introduces attacker-controlled statements in generated code.
Note: this exploit is not limited to default values, but may also impact properties names (serialization), path or query parameters, enum representations and other locations.
Remediation
- Upgrade Kiota to 1.31.1 or later.
- Regenerate/refresh existing generated clients as a precaution:
kiota update
Refreshing generated clients ensures previously generated vulnerable code is replaced with hardened output.
Acknowledgement
We would like to thank the researcher Thanatos Tian(Polyu) for finding this issue and for his contribution to this open source project.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| .NETNuGet | Microsoft.OpenApi.Kiota | ≥ 1.30.0&&< 1.31.1 | 1.31.1dotnet add package Microsoft.OpenApi.Kiota --version 1.31.1 |
| .NETNuGet | Microsoft.OpenApi.Kiota.Builder | ≥ 1.30.0&&< 1.31.1 | 1.31.1dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.31.1 |
| .NETNuGet | Microsoft.OpenApi.Kiota | all versions | 1.29.1dotnet add package Microsoft.OpenApi.Kiota --version 1.29.1 |
| .NETNuGet | Microsoft.OpenApi.Kiota.Builder | all versions | 1.29.1dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.29.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for Microsoft.OpenApi.Kiota, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update Microsoft.OpenApi.Kiota to 1.31.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-41134 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-41134 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-41134. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-41134 in your dependencies?
O3 Security finds CVE-2026-41134 across NuGet dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.