Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
.NET NuGet
Not in CISA KEV

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

Also known asGHSA-2hx3-vp6r-mg3f
Published
Apr 22, 2026
Updated
Aug 19, 2026
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed
Exploitation data as of Sep 21, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

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

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs36th percentile — riskier than 36% of all scored CVEsHighest risk

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

4 pkgs affected
.NETMicrosoft.OpenApi.Kiota.NETMicrosoft.OpenApi.Kiota.Builder.NETMicrosoft.OpenApi.Kiota.NETMicrosoft.OpenApi.Kiota.Builder

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

  1. the OpenAPI description used for generation is from an untrusted source, or
  2. 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

  1. Upgrade Kiota to 1.31.1 or later.
  2. 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

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
.NETNuGetMicrosoft.OpenApi.Kiota≥ 1.30.0&&< 1.31.11.31.1dotnet add package Microsoft.OpenApi.Kiota --version 1.31.1
.NETNuGetMicrosoft.OpenApi.Kiota.Builder≥ 1.30.0&&< 1.31.11.31.1dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.31.1
.NETNuGetMicrosoft.OpenApi.Kiotaall versions1.29.1dotnet add package Microsoft.OpenApi.Kiota --version 1.29.1
.NETNuGetMicrosoft.OpenApi.Kiota.Builderall versions1.29.1dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.29.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    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.

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

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

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

# 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
O3 Security · Impact-Aware SCA

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.

CVE-2026-41134: Microsoft.OpenApi.Kiota | O3 Security