CVE-2026-105796: Kiota: Code injection through doc-comment delimiter reformation in Kiota Java and PHP generators

Published Oct 6, 2026
·
Updated

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.

Other sources

Kiota is an OpenAPI based HTTP Client code generator. From 0.5.0 until 1.35.0, Kiota's Java and PHP documentation-comment sanitizers delete block-comment terminators rather than neutralizing them, allowing overlapping characters to reform a terminator and place attacker-controlled OpenAPI text outside a generated documentation comment. The Java sanitizer also removes non-ASCII characters after deleting terminators, which can create a new terminator during normalization. Exploitation requires a developer or build pipeline to generate source from the malicious description and then compile and load the Java output or load the PHP output, after which injected code executes in the consuming application or build environment context. The version range is based on the Java defect and does not assert that PHP generation existed in every affected release. This issue is fixed in version 1.35.0.

— MITRE

Affected Software

3 affected componentsFixes available
Microsoft Kiota>=0.5.0<1.35.0
nuget/Microsoft.OpenApi.Kiota.Builder>=0.5.0<1.35.0
1.35.0
nuget/Microsoft.OpenApi.Kiota>=0.5.0<1.35.0
1.35.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade nuget/Microsoft.OpenApi.Kiota.Builder to a version that resolves this vulnerability.

    Fixed in 1.35.0
  2. Upgrade

    Upgrade nuget/Microsoft.OpenApi.Kiota to a version that resolves this vulnerability.

    Fixed in 1.35.0
  3. Upgrade

    Upgrade Kiota to a version that resolves this vulnerability.

    Fixed in 1.35.0
  4. Compensating control

    Until upgrading, generate clients only from trusted, integrity-protected OpenAPI descriptions.

  5. Compensating control

    Restrict the privileges and secrets available to generation and build environments.

  6. Compensating control

    Review generated Java and PHP source before compiling, loading, or deploying it.

  7. Operational

    After upgrading, regenerate affected clients.

Event History

Oct 6, 2026
CVE Published
via MITRE·02:21 PM
Data Sourced
via MITRE·02:21 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:17 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·03:36 PM
Data Sourced
via GitHub·03:36 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Teams that generate Java or PHP clients from OpenAPI descriptions are exposed when those descriptions can be attacker-controlled or come from an untrusted source. The risk materializes in the application or build environment that compiles and loads the generated Java output or loads the generated PHP output.

2

What must an attacker provide or cause for exploitation?

An attacker needs a malicious OpenAPI description whose text is processed into generated documentation comments. A developer or build pipeline must then generate source from that description and compile and load the Java output, or load the PHP output.

3

Which versions should be remediated?

Kiota versions from 0.5.0 through 1.35.0 are identified as affected, and version 1.35.0 fixes the issue. The stated range is based on the Java defect and does not establish that PHP generation was present in every release in that range.

4

What should be done if generated clients cannot immediately be updated?

Do not generate or load clients from untrusted OpenAPI descriptions until the generator can be updated to the fixed version. Treat generated Java compilation/loading and PHP loading as execution of code in the consuming application or build environment context.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203