CVE-2026-73851: Microsoft Kiota Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-p5rm-jg5c-8c77
CWE-829 CWE-22
Published
Advisory Summary

CVE-2026-73851 is a MODERATE remote code execution vulnerability (CWE-829: Inclusion of Functionality from Untrusted Control Sphere) affecting Microsoft Kiota libraries in the NuGet ecosystem. The issue involves path traversal in generated plugin manifest static_template.file reference (percent-encoding bypass). Remediation is available by upgrading affected packages to version 1.29.1, 1.34.0.

CVE-2026-73851 at a Glance

CVE Identifier CVE-2026-73851
GHSA Identifier GHSA-p5rm-jg5c-8c77
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-829: Inclusion of Functionality from Untrusted Control Sphere
Affected Product Microsoft Kiota
Package Ecosystem NuGet
Published Date
Last Updated

How to Fix CVE-2026-73851

To remediate this vulnerability, upgrade all affected Microsoft Kiota dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Microsoft.OpenApi.Kiota fixed: 1.29.1
Upgrade Microsoft.OpenApi.Kiota to 1.29.1
Microsoft.OpenApi.Kiota fixed: 1.34.0
Upgrade Microsoft.OpenApi.Kiota to 1.34.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for Microsoft.OpenApi.Kiota

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-73851, inspect your project dependencies for Microsoft Kiota:

inspect dependencies for Microsoft.OpenApi.Kiota

Analyze the terminal output to locate any version of Microsoft Kiota in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.29.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere, where the product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. In Microsoft Kiota, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Kiota generates AI plugin manifests from an OpenAPI description. When the description contains an `x-ai-capabilities` response semantics `static_template` (or the adaptive-card extension `x-ai-adaptive-card`), the `file` reference is written into the generated manifest's `response_semantics.static_template.file` and is later resolved by the AI host **relative to the plugin package**. An attacker who controls or tampers with the OpenAPI description consumed by Kiota can supply a `file` reference that resolves **outside** the manifest package (e.g. `../../../../etc/passwd`, an absolute path, or a `file://` / `http(s)://` URI). When the generated manifest is deployed and consumed by an AI host, this can lead to inclusion or disclosure of files outside the intended package boundary (CWE-22 Path Traversal, CWE-829 Inclusion of Functionality from an Untrusted Control Sphere). A mitigation shipped in v1.32.5 (`ExtensionResponseSemanticsStaticTemplate.IsSafeFileReference`) rejected literal traversal, rooted paths, drive-qualified paths, and absolute URIs. However, that check inspected the **raw** reference string, so **percent-encoded** payloads bypassed every check and were still emitted verbatim. Examples that were incorrectly accepted as safe: | Input | Decodes to | |-------|-----------| | `%2e%2e/card.json` | `../card.json` | | `..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd` | `../../../../../../etc/passwd` | | `file%3A%2F%2F%2Fetc%2Fpasswd` | `file:///etc/passwd` | | `%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd` | `../../../etc/passwd` | Multi-level (double) encoding such as `%252e%252e%252fcard.json` was also affected. A follow-up review found additional residual bypasses of the same validator: an embedded NUL byte (`%00`) that truncated the path and defeated the parent-directory segment check, encoding nested deeper than the decode budget (which failed open), and Unicode full-width homoglyphs (e.g. `%EF%BC%8E%EF%BC%8E` → `..`). ### Patches - The percent-encoding bypass is fixed by decoding the reference (bounded multi-pass) before validation: https://github.com/microsoft/kiota/pull/7910 - Residual bypasses (NUL / control characters, decode-budget fail-open, Unicode homoglyphs) are fixed by failing closed on residual encoding, rejecting control characters, and NFKC-folding before validation: https://github.com/microsoft/kiota/pull/7913 (tracking issue https://github.com/microsoft/kiota/issues/7912) Users should upgrade to the first released `Microsoft.OpenApi.Kiota` version that includes these fixes (the release following 1.33.0). ### Workarounds - Only generate clients/plugins from trusted OpenAPI descriptions. - Review generated plugin manifests before deployment and reject any `response_semantics.static_template.file` value that is not a simple relative path within the `adaptiveCards/` package folder (no `..`, no rooted/absolute paths, no URIs, no percent-encoded separators). ### References - CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') - CWE-829: Inclusion of Functionality from an Untrusted Control Sphere - Affected code: `src/Kiota.Builder/OpenApiExtensions/OpenApiAiCapabilitiesExtension.cs` (`IsSafeFileReference`) and enforcement in `src/Kiota.Builder/Plugins/PluginsGenerationService.cs`.

CVE-2026-73851 Affected Microsoft Kiota Versions

2 component(s)
Fixed Versions:
1.29.11.34.0
Product / Package Ecosystem Affected Versions Fixed Version
Microsoft.OpenApi.Kiota
NuGet
< 1.29.1
1.29.1
Microsoft.OpenApi.Kiota
NuGet
≥ 1.30.0
< 1.34.0
1.34.0

References

Frequently Asked Questions

What is CVE-2026-73851?
CVE-2026-73851 is a security vulnerability in Microsoft Kiota involving Path traversal in generated plugin manifest static_template.file reference (percent-encoding bypass) under CWE-829: Inclusion of Functionality from Untrusted Control Sphere.
Which Microsoft Kiota versions are affected?
Affected versions include releases prior to 1.29.1, 1.34.0 across affected packages: Microsoft.OpenApi.Kiota.
What version fixes CVE-2026-73851?
Upgrading to 1.29.1, 1.34.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Microsoft.OpenApi.Kiota affected?
Yes, Microsoft.OpenApi.Kiota is affected in releases prior to 1.29.1, 1.34.0. Upgrade your dependency to 1.29.1, 1.34.0 or later.
What CWE is associated with CVE-2026-73851?
CVE-2026-73851 is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere (The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.).
How can I check NuGet dependencies for CVE-2026-73851?
Run the dependency tree command: 'inspect dependencies for Microsoft.OpenApi.Kiota'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p5rm-jg5c-8c77",
  "modified" : "2026-08-17T15:11:54Z",
  "published" : "2026-07-24T16:14:56Z",
  "aliases" : [ "CVE-2026-73851" ],
  "summary" : "Microsoft Kiota: Path traversal in generated plugin manifest static_template.file reference (percent-encoding bypass)",
  "details" : "### Impact\n\nKiota generates AI plugin manifests from an OpenAPI description. When the description contains an `x-ai-capabilities` response semantics `static_template` (or the adaptive-card extension `x-ai-adaptive-card`), the `file` reference is written into the generated manifest's `response_semantics.static_template.file` and is later resolved by the AI host **relative to the plugin package**.\n\nAn attacker who controls or tampers with the OpenAPI description consumed by Kiota can supply a `file` reference that resolves **outside** the manifest package (e.g. `../../../../etc/passwd`, an absolute path, or a `file://` / `http(s)://` URI). When the generated manifest is deployed and consumed by an AI host, this can lead to inclusion or disclosure of files outside the intended package boundary (CWE-22 Path Traversal, CWE-829 Inclusion of Functionality from an Untrusted Control Sphere).\n\nA mitigation shipped in v1.32.5 (`ExtensionResponseSemanticsStaticTemplate.IsSafeFileReference`) rejected literal traversal, rooted paths, drive-qualified paths, and absolute URIs. However, that check inspected the **raw** reference string, so **percent-encoded** payloads bypassed every check and were still emitted verbatim. Examples that were incorrectly accepted as safe:\n\n| Input | Decodes to |\n|-------|-----------|\n| `%2e%2e/card.json` | `../card.json` |\n| `..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd` | `../../../../../../etc/passwd` |\n| `file%3A%2F%2F%2Fetc%2Fpasswd` | `file:///etc/passwd` |\n| `%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd` | `../../../etc/passwd` |\n\nMulti-level (double) encoding such as `%252e%252e%252fcard.json` was also affected. A follow-up review found additional residual bypasses of the same validator: an embedded NUL byte (`%00`) that truncated the path and defeated the parent-directory segment check, encoding nested deeper than the decode budget (which failed open), and Unicode full-width homoglyphs (e.g. `%EF%BC%8E%EF%BC%8E` → `..`).\n\n### Patches\n\n- The percent-encoding bypass is fixed by decoding the reference (bounded multi-pass) before validation: https://github.com/microsoft/kiota/pull/7910\n- Residual bypasses (NUL / control characters, decode-budget fail-open, Unicode homoglyphs) are fixed by failing closed on residual encoding, rejecting control characters, and NFKC-folding before validation: https://github.com/microsoft/kiota/pull/7913 (tracking issue https://github.com/microsoft/kiota/issues/7912)\n\nUsers should upgrade to the first released `Microsoft.OpenApi.Kiota` version that includes these fixes (the release following 1.33.0).\n\n### Workarounds\n\n- Only generate clients/plugins from trusted OpenAPI descriptions.\n- Review generated plugin manifests before deployment and reject any `response_semantics.static_template.file` value that is not a simple relative path within the `adaptiveCards/` package folder (no `..`, no rooted/absolute paths, no URIs, no percent-encoded separators).\n\n### References\n\n- CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')\n- CWE-829: Inclusion of Functionality from an Untrusted Control Sphere\n- Affected code: `src/Kiota.Builder/OpenApiExtensions/OpenApiAiCapabilitiesExtension.cs` (`IsSafeFileReference`) and enforcement in `src/Kiota.Builder/Plugins/PluginsGenerationService.cs`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Microsoft.OpenApi.Kiota"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.30.0"
      }, {
        "fixed" : "1.34.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Microsoft.OpenApi.Kiota"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.29.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/security/advisories/GHSA-p5rm-jg5c-8c77"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/issues/7912"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/pull/7910"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/pull/7913"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/commit/430008e9d700b3fe80f206c672415cfbd8e830e7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/commit/de3d18d9fe31ced4ac749728d3a2f94811f59268"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/microsoft/kiota"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/releases/tag/v1.34.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-829" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T16:14:56Z",
    "nvd_published_at" : null
  }
}