# CVE-2026-41134: Microsoft.OpenApi.Kiota — Fixed in 1.31.1

.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 as[GHSA-2hx3-vp6r-mg3f](/vulnerability/GHSA-2hx3-vp6r-mg3f)

Published

Apr 22, 2026

Updated

Nov 7, 2026

Affected

4 pkgs

Patched

4 / 4

Exploits

None indexed

Exploitation data as of Nov 7, 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 ↗](https://www.first.org/epss/)

0.4%probability of exploitation in next 30 days

Lower Risk0.00%

Lower risk than most CVEs37th percentile — riskier than 37% of all scored CVEsHighest risk

0.00%0.31%0.61%0.92%0.1%0.4%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from [FIRST.org EPSS](https://www.first.org/epss/).

## Real-World Exposure

4 pkgs affected

.NET`Microsoft.OpenApi.Kiota`.NET`Microsoft.OpenApi.Kiota.Builder`.NET`Microsoft.OpenApi.Kiota`.NET`Microsoft.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

Ecosystem

Package

Vulnerable range

Fix

.NETNuGet

`Microsoft.OpenApi.Kiota` 

≥ 1.30.0&&< 1.31.1

1.31.1`dotnet add package Microsoft.OpenApi.Kiota --version 1.31.1`

.NETNuGet

`Microsoft.OpenApi.Kiota.Builder` 

≥ 1.30.0&&< 1.31.1

1.31.1`dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.31.1`

.NETNuGet

`Microsoft.OpenApi.Kiota` 

all versions

1.29.1`dotnet add package Microsoft.OpenApi.Kiota --version 1.29.1`

.NETNuGet

`Microsoft.OpenApi.Kiota.Builder` 

all versions

1.29.1`dotnet add package Microsoft.OpenApi.Kiota.Builder --version 1.29.1`

## Affected Products

1 product · 1 configurations

Application

`kiota`microsoft

< 1.31.1

range

## 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
    
    Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
    

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

Find it across NuGet, including transitive dependencies.

[Scan my dependencies](/book-demo) [How O3 SCA works](/impact-aware-sca)