CVE-2026-25592: Semantic Kernel has Arbitrary File Write via AI Agent Function Calling in .NET SDK
Microsoft's Semantic Kernel .NET SDK lets a model write arbitrary files on the host through `SessionsPythonPlugin`. Its `DownloadFileAsync` and `UploadFileAsync` functions accept a model-chosen local path with no check. The advisory says to upgrade Microsoft.SemanticKernel.Plugins.Core to 1.71.0 or higher.
Published Feb 6, 2026 · Updated Feb 20, 2026 · Analysis Nov 1, 2026
What an attacker can do
SessionsPythonPlugin exposes file functions to the model through function calling. DownloadFileAsync takes a localFilePath argument, and nothing restricts where on the host it writes. A model steered by a prompt injection, or a user of the app who can prompt it, can pick any path the app process can write, and the content comes from the code-interpreter session. That is an arbitrary file write, and it can be turned into code execution by overwriting app or startup files.
The attacker needs only low privileges: access to the application's chat or to content the agent processes. No user interaction is needed. The advisory scores it 9.9 critical with changed scope, and path traversal (CWE-22) is the weakness. Developers are affected only if their app registers SessionsPythonPlugin and lets the model call it.
Who is affected
Applications built on the Semantic Kernel .NET SDK that use SessionsPythonPlugin from Microsoft.SemanticKernel.Plugins.Core below 1.71.0. The data lists the NuGet package Microsoft.SemanticKernel.Core below 1.71.0 and the pip package semantic-kernel below 1.39.3, but the advisory text is about the .NET plugin. Apps without that plugin are not described as affected.
dotnet list package | grep SemanticKernelFor Python projects, run pip show semantic-kernel.
semantic-kernel
- Ecosystem
- PyPI
- Affected
- < 1.39.3
- Fixed in
- 1.39.3
- Check
pip show semantic-kernel
Microsoft.SemanticKernel.Core
- Ecosystem
- NuGet
- Affected
- < 1.71.0
- Fixed in
- 1.71.0
- Check
dotnet list package --include-transitive
How to fix it
Upgrade Microsoft.SemanticKernel.Plugins.Core to 1.71.0 or higher:
dotnet add package Microsoft.SemanticKernel.Plugins.Core --version 1.71.0The fix PR #13478 adds file-transfer controls. Uploads are deny by default and need EnableDangerousFileUploads set to true and AllowedUploadDirectories configured. Downloads are validated when AllowedDownloadDirectories is set. Paths are canonicalized in both directions. Set the allowed directories explicitly.
Workaround from the advisory: add a Function Invocation Filter that checks the arguments of calls to DownloadFileAsync or UploadFileAsync and allows only listed localFilePath values. The data lists the Python package fix as semantic-kernel 1.39.3.
How to tell if you were hit
Log and review calls to DownloadFileAsync and UploadFileAsync, in particular localFilePath values with .., absolute paths or locations outside your working directory. On the host, look for files written by the app's process in unexpected places, such as startup scripts, config files or web roots, with times matching an agent session. Beam, if installed beside agents on developer machines, records file access and flags risky ones, but this SDK runs inside your own application, so rely on your app logs.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
_What kind of vulnerability is it? Who is impacted?_ An Arbitrary File Write vulnerability has been identified in Microsoft's Semantic Kernel .NET SDK, specifically within the SessionsPythonPlugin. Developers who have built applications which include Microsoft's Semantic Kernel .NET SDK and are using the SessionsPythonPlugin
Patches
_Has the problem been patched? What versions should users upgrade to?_ The problem has been fixed in Microsoft.SemanticKernel.Plugins.Core version 1.71.0. Users should upgrade to version 1.71.0 or higher.
Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_ Users can create a Function Invocation Filter which checks the arguments being passed to any calls to DownloadFileAsync or UploadFileAsync and ensures the provided localFilePath is allow listed.
References
_Are there any links users can visit to find out more?_
Credited to doredry, amiteliahu, urioren.
Questions
- Does CVE-2026-25592 need the attacker to be an app user?
Low privileges are enough: access to the app's prompt or to content the agent reads. The CVSS vector has no user interaction and scores 9.9.
- Which plugin is affected?
SessionsPythonPluginin the .NET SDK, specifically itsDownloadFileAsyncandUploadFileAsyncfunctions.- Is there a workaround besides upgrading?
Yes. A Function Invocation Filter that allow-lists the
localFilePathargument of both functions, as the advisory describes.
References
Read for this analysis:
- https://github.com/microsoft/semantic-kernel/security/advisories/GHSA-2ww3-72rp-wpp4
- https://github.com/microsoft/semantic-kernel/pull/13478
- https://github.com/microsoft/semantic-kernel/pull/13478/changes#diff-88d3cacba2bfa84eef8f2aa171b34f9940338cbb784a3ffc49f5fe3af1b8943d
- https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Demos/CodeInterpreterPlugin/Program.cs#L61-L64
- https://nvd.nist.gov/vuln/detail/CVE-2026-25592
- https://github.com/advisories/GHSA-2ww3-72rp-wpp4
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
