CVE-2026-105796: Kiota Code Injection Through Doc-comment Delimiter Vulnerability

HIGH
Advisory Identifier: GHSA-rm89-rhwj-9j92
CVSS 8.8
CWE-94
Published
Advisory Summary

CVE-2026-105796 is a HIGH (CVSS 8.8) code injection through doc-comment delimiter vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Kiota libraries in the NuGet ecosystem. The issue involves code injection through doc-comment delimiter reformation in kiota java and php generators. Remediation is available by upgrading affected packages to version 1.35.0.

CVE-2026-105796 at a Glance

CVE Identifier CVE-2026-105796
GHSA Identifier GHSA-rm89-rhwj-9j92
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Kiota
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-105796

To remediate this vulnerability, upgrade all affected 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.35.0
Upgrade Microsoft.OpenApi.Kiota to 1.35.0
Microsoft.OpenApi.Kiota.Builder fixed: 1.35.0
Upgrade Microsoft.OpenApi.Kiota.Builder to 1.35.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-105796, inspect your project dependencies for Kiota:

inspect dependencies for Microsoft.OpenApi.Kiota

Analyze the terminal output to locate any version of Kiota in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.35.0), 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In 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 An attacker who controls or tampers with an OpenAPI description can cause Kiota to emit attacker-controlled Java or PHP source outside a generated documentation comment. The affected sanitizers remove comment terminators rather than neutralizing them, allowing a terminator to reform from overlapping characters or from subsequent normalization. The Java sanitizer also removes non-ASCII characters after removing terminators, which can create a new terminator. Exploitation requires a developer or build pipeline to generate a client from the malicious description and subsequently compile and load the Java output, or load the PHP output. Code executes in the consuming application's or build environment's security context, not merely because Kiota reads the description. ### Affected versions The affected NuGet packages are `Microsoft.OpenApi.Kiota` and `Microsoft.OpenApi.Kiota.Builder`. The Java normalization-order defect was introduced in version 0.5.0 and remains present through version 1.34.1, including the separate 1.29.1 security-backport release. The PHP delimiter-reformation variant is also present in version 1.34.1 and 1.29.1. Version 1.35.0 fixes both variants. The package version range below reflects the Java defect; it does not assert that PHP generation existed in every version in that range. ### Patches Upgrade to Kiota 1.35.0 or later and regenerate affected clients. The fix neutralizes block-comment delimiters instead of deleting them, and performs Java delimiter neutralization after non-ASCII normalization. - Fix: https://github.com/microsoft/kiota/pull/8017 - Fixed release: https://github.com/microsoft/kiota/releases/tag/v1.35.0 ### Workarounds Until upgrading, generate clients only from trusted, integrity-protected OpenAPI descriptions. Review generated Java and PHP source before compiling, loading, or deploying it. Restrict the privileges and secrets available to generation and build environments. ### Related advisories This is distinct from PHP double-quoted string interpolation (GHSA-jqwh-526h-c92j) and C# XML documentation newline breakout (GHSA-3hrf-2gc2-mx32). Those fixes do not address Java/PHP block-comment delimiter reformation.

CVE-2026-105796 Affected Kiota Versions

2 component(s)
Fixed Versions:
1.35.0
Product / Package Ecosystem Affected Versions Fixed Version
Microsoft.OpenApi.Kiota
NuGet
≥ 0.5.0
< 1.35.0
1.35.0
Microsoft.OpenApi.Kiota.Builder
NuGet
≥ 0.5.0
< 1.35.0
1.35.0

References

Frequently Asked Questions

What is CVE-2026-105796?
CVE-2026-105796 is a security vulnerability in Kiota involving Code injection through doc-comment delimiter reformation in Kiota Java and PHP generators under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Kiota versions are affected?
Affected versions include releases prior to 1.35.0 across affected packages: Microsoft.OpenApi.Kiota, Microsoft.OpenApi.Kiota.Builder.
What version fixes CVE-2026-105796?
Upgrading to 1.35.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.35.0. Upgrade your dependency to 1.35.0 or later.
Is Microsoft.OpenApi.Kiota.Builder affected?
Yes, Microsoft.OpenApi.Kiota.Builder is affected in releases prior to 1.35.0. Upgrade your dependency to 1.35.0 or later.
What is the CVSS score of CVE-2026-105796?
CVE-2026-105796 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-105796?
CVE-2026-105796 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check NuGet dependencies for CVE-2026-105796?
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-rm89-rhwj-9j92",
  "modified" : "2026-10-06T15:36:00Z",
  "published" : "2026-10-06T15:36:00Z",
  "aliases" : [ "CVE-2026-105796" ],
  "summary" : "Kiota: Code injection through doc-comment delimiter reformation in Kiota Java and PHP generators",
  "details" : "### Impact\n\nAn attacker who controls or tampers with an OpenAPI description can cause Kiota to emit attacker-controlled Java or PHP source outside a generated documentation comment. The affected sanitizers remove comment terminators rather than neutralizing them, allowing a terminator to reform from overlapping characters or from subsequent normalization. The Java sanitizer also removes non-ASCII characters after removing terminators, which can create a new terminator.\n\nExploitation requires a developer or build pipeline to generate a client from the malicious description and subsequently compile and load the Java output, or load the PHP output. Code executes in the consuming application's or build environment's security context, not merely because Kiota reads the description.\n\n### Affected versions\n\nThe affected NuGet packages are `Microsoft.OpenApi.Kiota` and `Microsoft.OpenApi.Kiota.Builder`. The Java normalization-order defect was introduced in version 0.5.0 and remains present through version 1.34.1, including the separate 1.29.1 security-backport release. The PHP delimiter-reformation variant is also present in version 1.34.1 and 1.29.1. Version 1.35.0 fixes both variants.\n\nThe package version range below reflects the Java defect; it does not assert that PHP generation existed in every version in that range.\n\n### Patches\n\nUpgrade to Kiota 1.35.0 or later and regenerate affected clients. The fix neutralizes block-comment delimiters instead of deleting them, and performs Java delimiter neutralization after non-ASCII normalization.\n\n- Fix: https://github.com/microsoft/kiota/pull/8017\n- Fixed release: https://github.com/microsoft/kiota/releases/tag/v1.35.0\n\n### Workarounds\n\nUntil upgrading, generate clients only from trusted, integrity-protected OpenAPI descriptions. Review generated Java and PHP source before compiling, loading, or deploying it. Restrict the privileges and secrets available to generation and build environments.\n\n### Related advisories\n\nThis is distinct from PHP double-quoted string interpolation (GHSA-jqwh-526h-c92j) and C# XML documentation newline breakout (GHSA-3hrf-2gc2-mx32). Those fixes do not address Java/PHP block-comment delimiter reformation.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Microsoft.OpenApi.Kiota"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.5.0"
      }, {
        "fixed" : "1.35.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Microsoft.OpenApi.Kiota.Builder"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.5.0"
      }, {
        "fixed" : "1.35.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/security/advisories/GHSA-rm89-rhwj-9j92"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-105796"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/pull/8017"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/commit/68f33b865be9273464a6efbbe17379760e51f1a4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/microsoft/kiota"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/kiota/releases/tag/v1.35.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-06T15:36:00Z",
    "nvd_published_at" : "2026-10-06T15:17:16Z"
  }
}