Summary
Microsoft Kiota: Path traversal in generated plugin manifest static_template.file reference (percent-encoding bypass)
Workarounds
- Only generate clients/plugins from trusted OpenAPI descriptions.
- Review generated plugin manifests before deployment and reject any
response_semantics.static_template.filevalue that is not a simple relative path within theadaptiveCards/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 insrc/Kiota.Builder/Plugins/PluginsGenerationService.cs.
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 → ..).
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
- 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).
Frequently Asked Questions
- What is GHSA-P5RM-JG5C-8C77? GHSA-P5RM-JG5C-8C77 is a medium-severity path traversal vulnerability in Microsoft.OpenApi.Kiota (nuget), affecting versions <= 1.33.0. It is fixed in 1.34.0. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
- Which versions of Microsoft.OpenApi.Kiota are affected by GHSA-P5RM-JG5C-8C77? Microsoft.OpenApi.Kiota (nuget) versions <= 1.33.0 is affected.
- Is there a fix for GHSA-P5RM-JG5C-8C77? Yes. GHSA-P5RM-JG5C-8C77 is fixed in 1.34.0. Upgrade to this version or later.
- Is GHSA-P5RM-JG5C-8C77 exploitable, and should I be worried? Whether GHSA-P5RM-JG5C-8C77 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-P5RM-JG5C-8C77 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-P5RM-JG5C-8C77? Upgrade
Microsoft.OpenApi.Kiotato 1.34.0 or later.