GHSA-p5rm-jg5c-8c77

Suggest an improvement
Source
https://github.com/advisories/GHSA-p5rm-jg5c-8c77
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-p5rm-jg5c-8c77/GHSA-p5rm-jg5c-8c77.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-p5rm-jg5c-8c77
Aliases
Published
2026-07-24T16:14:56Z
Modified
2026-08-17T15:25:59Z
Severity
  • 6.1 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
Microsoft Kiota: Path traversal in generated plugin manifest static_template.file reference (percent-encoding bypass)
Details

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

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.
Database specific
{
    "cwe_ids": [
        "CWE-22",
        "CWE-829"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-24T16:14:56Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
}
References

Affected packages

NuGet / Microsoft.OpenApi.Kiota

Package

Name
Microsoft.OpenApi.Kiota
View open source insights on deps.dev
Purl
pkg:nuget/Microsoft.OpenApi.Kiota

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.30.0
Fixed
1.34.0

Affected versions

1.*
1.30.0
1.31.0
1.31.1
1.32.0
1.32.1
1.32.2
1.32.3
1.32.4
1.32.5
1.33.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-p5rm-jg5c-8c77/GHSA-p5rm-jg5c-8c77.json"

NuGet / Microsoft.OpenApi.Kiota

Package

Name
Microsoft.OpenApi.Kiota
View open source insights on deps.dev
Purl
pkg:nuget/Microsoft.OpenApi.Kiota

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.29.1

Affected versions

0.*
0.1.0-preview
0.1.1-preview
0.1.2-preview
0.1.3-preview
0.2.0-preview
0.2.1-preview
0.3.0-preview
0.4.0-preview
0.5.0-preview
0.5.1-preview
0.6.0-preview
0.7.1-preview
0.8.3-preview
0.9.0-preview
0.10.0-preview
0.11.0-preview
0.11.1-preview
1.*
1.0.0
1.0.1
1.1.0
1.1.1
1.1.2
1.1.3
1.2.0
1.2.1
1.3.0
1.4.0
1.5.0
1.5.1
1.6.1
1.7.0
1.8.0
1.8.1
1.8.2
1.9.0
1.9.1
1.10.0
1.10.1
1.11.0
1.11.1
1.12.0
1.13.0
1.14.0
1.15.0
1.16.0
1.17.0
1.18.0
1.19.0
1.19.1
1.20.0
1.21.0
1.22.0
1.22.1
1.22.2
1.22.3
1.23.0
1.24.0
1.24.1
1.24.2
1.24.3
1.25.1
1.26.0
1.26.1
1.27.0
1.28.0
1.29.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-p5rm-jg5c-8c77/GHSA-p5rm-jg5c-8c77.json"