{"id":"CVE-2026-73851","aliases":["GHSA-p5rm-jg5c-8c77"],"url":"https://o3.security/vulnerability/CVE-2026-73851","summary":"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`.","published":"2026-08-17T15:11:39.724Z","modified":"2026-09-29T14:07:14.034162Z","cvss":null,"epss":{"score":0.01479,"percentile":0.72452,"asOf":"2026-09-14"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"NuGet","name":"Microsoft.OpenApi.Kiota","fixedVersion":"1.34.0"},{"ecosystem":"NuGet","name":"Microsoft.OpenApi.Kiota","fixedVersion":"1.29.1"}],"fix":{"url":"https://github.com/microsoft/kiota/commit/430008e9d700b3fe80f206c672415cfbd8e830e7","label":"microsoft/kiota@430008e"},"references":[{"type":"WEB","url":"https://github.com/microsoft/kiota/releases/tag/v1.29.1"},{"type":"WEB","url":"https://github.com/microsoft/kiota/releases/tag/v1.34.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/73xxx/CVE-2026-73851.json"},{"type":"ADVISORY","url":"https://github.com/microsoft/kiota/security/advisories/GHSA-p5rm-jg5c-8c77"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-73851"},{"type":"REPORT","url":"https://github.com/microsoft/kiota/issues/7912"},{"type":"FIX","url":"https://github.com/microsoft/kiota/commit/430008e9d700b3fe80f206c672415cfbd8e830e7"},{"type":"FIX","url":"https://github.com/microsoft/kiota/commit/de3d18d9fe31ced4ac749728d3a2f94811f59268"},{"type":"FIX","url":"https://github.com/microsoft/kiota/pull/7910"},{"type":"FIX","url":"https://github.com/microsoft/kiota/pull/7913"},{"type":"PACKAGE","url":"https://github.com/microsoft/kiota"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-09-29T14:07:14.034162Z"}}