// threat brief

Microsoft Semantic Kernel (Python) runs InMemoryVectorStore filter conditions as code

CVSS
9.9 CRITICAL
CISA KEV
Not listed
Weakness
CWE-94

PlainCVE Team · Published 2026-09-23 · Updated 2026-09-24 · AI-assisted · Press brief ↓

Human review 2026-09-23Command tests: none yetReproduced: not yetVerification record ↓

Semantic Kernel turns the filter an AI model writes for a search plugin into Python code and runs it; prompt injection can make that run any code on the server.

Who is affectedApplications using the Python semantic-kernel before 1.39.4 that hand InMemoryVectorStore to the model as a search plugin (function calling) with the default filter settings. The .NET and Java versions are not listed as affected.
What happensAn attacker may be able to run code on the host with the application's permissions, read keys, tamper with data, or use it as a stepping stone.
What to do nowUpgrade semantic-kernel to 1.39.4 or later. Don't use InMemoryVectorStore in production.
View evidence(4)
  • Vendor / maintainerMicrosoft's advisory: don't use InMemoryVectorStore in productionAvoid using InMemoryVectorStore for production scenarios.github.com
  • Vendor / maintainerMicrosoft's research post: upgrading to 1.39.4 or later mitigates the riskUpgrading the Python semantic-kernel dependency to version 1.39.4 or higher mitigates the risk.microsoft.com
  • Vendor / maintainerMicrosoft's advice: if you find suspicious activity, treat it as a potential host compromise, review the host, rotate credentials and tokens the agent can access, and investigate what the host can reachtreat it as a potential host compromise. Review the affected host, rotate credentials and tokens accessible to the agent, and investigate what data or systems that host could reach.microsoft.com
  • Our assessmentIf exploitation cannot be ruled out, also rotating the host's other keys is PlainCVE's suggestion, not Microsoft's
Affected versionsAll versions before 1.39.4
View evidence(4)
  • Vendor / maintainerMicrosoft's advisory: the flaw is in the Python SDK's InMemoryVectorStore filter functionalityAn RCE vulnerability has been identified in Microsoft Semantic Kernel Python SDK, specifically within the InMemoryVectorStore filter functionality.github.com
  • CVE recordCVE record: versions before 1.39.4 are affectedhas a remote code execution vulnerability in versions prior to 1.39.4cve.org
  • Vendor / maintainerMicrosoft's research post: the affected setup uses the In-Memory Vector Store as the Search Plugin backend with default configurationIt uses the In-Memory Vector Store and relies on its filter functionality (when acting as the backend for the Search Plugin using default configurations).microsoft.com
  • Vendor / maintainerThe 1.39.3 source already allowlists syntax nodes and functions but does not restrict attribute names, so it is still affectedgithub.com
Fixed versions1.39.4 or later
View evidence(3)
  • Vendor / maintainerMicrosoft's advisory: fixed in python-1.39.4; upgrade to that version or laterThe problem has been fixed in python-1.39.4. Users should upgrade this version or higher.github.com
  • Vendor / maintainerThe 1.39.4 source adds a blocklist of dangerous attribute names but still runs filter strings through a restricted evalBlocklist of dangerous attribute names that cannot be accessed in filter expressions.github.com
  • Vendor / maintainerThe python-1.39.4 release notes include fix PR #13505Python: refinement of filteringgithub.com
CVSS vector
Show full vectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Timeline
  • Introduced 2025-06-25 · semantic-kernel 1.34.0 released with text filters source
  • First public 2026-02-19
CISA KEVNot listed(Not being in KEV does not mean it has not been exploited)
View evidence(2)
  • Our assessmentOur 2026-09-24 snapshot of the CISA KEV catalog does not list this CVE; not being listed does not mean it has not been exploited
  • Our assessmentWe found no public record of exploitation

Blue team playbook

Check, fix / mitigate, respond, harden. Matching the affected versions does not mean you were compromised, and a check that finds nothing does not prove you are safe; each item says what it can and cannot show. Tagged steps point to where the attack flow below can be stopped.

DETECTCheckAm I affected? Any signs of compromise?
  1. 01Check your semantic-kernel version

    The Python semantic-kernel before 1.39.4 is affected; 1.39.4 or later is fixed. The .NET and Java versions are not listed as affected in the official advisory.

    Read-only check
    pip show semantic-kernel
  2. 02Find out whether InMemoryVectorStore is handed to the model

    Search your code for InMemoryVectorStore or InMemoryCollection. The affected setup hands it to the model as a search plugin (function calling) with the default filter settings; other vector database connectors are not listed as affected in the official advisory.

  3. 03Look back for suspicious child processes spawned by the AI application

    Microsoft recommends looking back over the period "between deploying an affected version and upgrading" for suspicious child processes spawned by the AI application.

MITIGATEFix / mitigatePatch; block it if you cannot patch yet
  1. 01Upgrade to 1.39.4 or later

    1.39.4 keeps the existing syntax-node and function restrictions and adds a block on 44 dangerous internal attribute names. The library itself still runs the filter string with a restricted eval.

    Changes your environment
    pip install -U "semantic-kernel>=1.39.4"
  2. 02Don't use InMemoryVectorStore in production

    This is the mitigation given in the official advisory; InMemoryVectorStore was designed for development and testing in the first place.

RESPONDRespondIf you find signs of compromise
  1. 01If you find suspicious activity, treat it as a potential host compromise and review the host

    Microsoft's advice is to treat it as a "potential" host compromise, review the affected host, and investigate what data or systems that host could reach.

  2. 02Rotate the credentials and tokens accessible to the agent

    This is part of Microsoft's advice. An attacker may be able to read keys with the application's permissions.

  3. 03If you can't rule it out, also rotate the other keys on the host

    PlainCVE's own suggestion (not Microsoft's advice). If you can't rule out exploitation, play it safe and rotate the other keys on that host too.

HARDENHardenPrevent the next one
  1. 01Give the tools the model can call only the minimum permissions

    The model can be manipulated by prompt injection, so the fewer permissions its tools have, the less damage it can do when that happens.

  2. 02Handle untrusted content separately from system instructions

    Malicious instructions could be typed by a user, or hidden in a document or web page the model reads (indirect prompt injection).

  3. 03Don't let model output become executable code

    In your own application, represent filter conditions as structured data, with no eval involved.

  4. 04Run AI applications under a low-privilege account and inside a container

    Even if code does run on the host, it only gets limited permissions. Also monitor for unusual child processes spawned by the AI application.

Full remediation steps and notes
  1. Upgrade. pip install -U "semantic-kernel>=1.39.4".
  2. Don’t use InMemoryVectorStore in production. This is the mitigation given in the official advisory; it was designed for development and testing in the first place.
  3. Check whether you were exploited. Microsoft recommends looking back over the period “between deploying an affected version and upgrading” for suspicious child processes spawned by the AI application. Microsoft’s advice: if you find suspicious activity, treat it as a potential host compromise, review the affected host, rotate the credentials and tokens accessible to the agent, and investigate what data or systems that host could reach. PlainCVE additionally suggests: if you can’t rule it out, play it safe and rotate the other keys on that host too.
  4. General principles. Give the tools the model can call only the minimum permissions; run AI applications under a low-privilege account and inside a container.

Attack flow

Read left to right: this is the order the attack happens in. A blue shield means the step can be stopped; the earlier, the better. Click an icon for details.

Microsoft Semantic Kernel (Python) runs InMemoryVectorStore filter conditions as code: 1. Hides instructions in text the model will read → 2. The model calls the search plugin and chooses the filter parameters itself → 3. The parameters are spliced into a Python lambda string → 4. Code that slips past the checks runs on the hostCVE-2026-26030 · Microsoft Semantic Kernel (Python) runs InMemoryVectorStore filterconditions as codeAttackerYour systemHides instructions in text the model will read — This could be typed directly by a user, or come from a document or web page the model reads (indirect prompt injection). 1Hides instructionsin text the modelwill readThe model calls the search plugin and chooses the filter parameters itself — The parameters are shaped by the text from the previous step, so they are no longer the simple keywords the developer expected. 2The model callsthe search pluginand chooses thefilter parameter…The parameters are spliced into a Python lambda string — Older versions built the filter function as a string, checked its syntax tree, and then ran it. Early versions used a blocklist of dangerous names; from 1.39.2 the check allowed only specific syntax nodes and function calls, but did not limit which attributes could be accessed. 3The parameters arespliced into aPython lambdastringCode that slips past the checks runs on the host — Python's dynamic nature makes it very hard for this kind of check to catch everything; an attacker can reach dangerous functionality through the internal attributes of objects. 4Code that slipspast the checksruns on the hostAttack pathCan be stopped herePlainCVE · plaincve.date/en/vulns/cve-2026-26030-semantic-kernel-filter-rce · CC BY 4.0
Free to use in reporting and teaching under CC BY 4.0. Attribution is already on the image.
  1. Attacker

    Hides instructions in text the model will read

    This could be typed directly by a user, or come from a document or web page the model reads (indirect prompt injection).

    Defense: Give the tools the model can call the least privilege possible; handle untrusted content separately from system instructions.

  2. Your system

    The model calls the search plugin and chooses the filter parameters itself

    The parameters are shaped by the text from the previous step, so they are no longer the simple keywords the developer expected.

  3. Your system

    The parameters are spliced into a Python lambda string

    Older versions built the filter function as a string, checked its syntax tree, and then ran it. Early versions used a blocklist of dangerous names; from 1.39.2 the check allowed only specific syntax nodes and function calls, but did not limit which attributes could be accessed.

    Defense: Upgrade to 1.39.4+, which adds blocking of dangerous internal attribute names on top of the existing syntax-node and function restrictions.

  4. Your system

    Code that slips past the checks runs on the host

    Python's dynamic nature makes it very hard for this kind of check to catch everything; an attacker can reach dangerous functionality through the internal attributes of objects.

    Defense: Monitor for unusual child processes spawned by the AI application; run it under a low-privilege account and isolate it in a container.

Who is affected

ConditionAffected?
Python semantic-kernel before 1.39.4 + using the InMemoryVectorStore search plugin + callable by the model (function calling) + default filter settingsAffected
Python semantic-kernel 1.39.4 or laterFixed
Using a different vector database connector (not InMemory)Not listed as affected in the official advisory
.NET / Java versions of Semantic KernelNot listed as affected in the official advisory

Check your version with pip show semantic-kernel, then search your code for InMemoryVectorStore or InMemoryCollection.

How it works

Semantic Kernel lets developers wrap features like “search the data” as plugins and hand them to an AI model, which decides on its own when to call them and with what parameters. The problem lies in how the InMemory vector database handles “filter conditions.”

Older versions assembled the filter condition into a string of Python code (a lambda function) and then had Python run it. When the model filled in the plugin’s parameters, the text it produced was spliced right into that code.

The flawed approach (conceptual illustration, not the original source code):

Show code example(python)
# Parameters chosen by the model are spliced directly into a code string
expr = f"lambda record: record.category == '{model_argument}'"
filter_fn = eval(expr)   # the string becomes real code

The developers did put up defenses: older versions first parsed the string into a syntax tree, allowed only a lambda, and blocked dangerous names such as eval, exec, and open. But Microsoft’s research article points out that in a highly dynamic language like Python, a blocklist is “inherently fragile”: by digging through an object’s internal attributes layer by layer, you can reach dangerous functionality without ever writing a blocked name. From 1.39.2, the check switched to an allowlist (only specific syntax nodes and function calls), but it did not limit attribute names, so every version before 1.39.4 is still affected.

This is CWE-94 (improper control of generation of code): a filter value that should only ever be “data” becomes “code.” And the one feeding in that data is an AI model, which can itself be manipulated by prompt injection, so the whole chain becomes “a piece of text → the server runs code.”

An alternative design (a conceptual illustration for your own application, not the actual 1.39.4 fix):

Show code example(python)
# Represent the filter condition as structured data, with no eval involved
filter_spec = {"field": "category", "op": "eq", "value": model_argument}
results = [r for r in records if getattr(r, filter_spec["field"]) == filter_spec["value"]]

Note that the semantic-kernel library itself still runs the filter string with a restricted eval in 1.39.4; it did not switch to the approach above. The 1.39.4 fix keeps the existing syntax tree check (only specific node types and function calls are allowed) and adds a block on 44 dangerous internal attribute names. For your own code, the more fundamental rule is: don’t let model output become executable code.

Timeline

DateEvent
2026-02-03Fix PR #13505 opened
2026-02-10PR merged, python-1.39.4 released
2026-02-19GitHub security advisory and CVE published
2026-03-10Included in Microsoft’s March Security Update Guide
2026-05-07Microsoft publishes its research article on RCE in AI agent frameworks

Further reading

  • The same Microsoft research also disclosed CVE-2026-25592: a file download feature that the AI can call, which lets the sandbox write files to the host.
  • Related weakness types: CWE-94 improper control of generation of code, prompt injection (LLM01 in the OWASP LLM Top 10).
  • Scoring differences: GitHub / NVD rate it CVSS 9.9 Critical; MSRC rates it Important with CWE-749. This page uses the scores from the CNA (GitHub) and NVD.

Verification Reviewed and checked against sources; not yet reproduced in our lab

Reviewed2026-09-23

Verification records describe the environment and the result only, never reproduction steps or code that could attack other people’s systems. See our policy.

Sources

  1. Othersemantic-kernel 1.34.0 released with text filters · pypi.org · accessed 2026-09-24
  2. AdvisoryGHSA-xjw9-4gw8-4rqx — InMemoryVectorStore filter functionality vulnerable to remote code execution · Microsoft (GitHub), 2026-02-19 · accessed 2026-09-23
  3. CVE / NVD / OSVCVE-2026-26030 Record · CVE Program, 2026-02-19 · accessed 2026-09-23
  4. CVE / NVD / OSVNVD - CVE-2026-26030 · NIST · accessed 2026-09-23
  5. VendorMSRC Security Update Guide — CVE-2026-26030 · Microsoft, 2026-03-10 · accessed 2026-09-23
    MSRC lists the CWE as CWE-749 and rates the severity Important; GitHub / NVD list CWE-94 and 9.9 Critical.
  6. Patch / releasePython: refinement of filtering (PR #13505) · Microsoft (GitHub), 2026-02-10 · accessed 2026-09-23
  7. Patch / releasepython-1.39.4 release · Microsoft (GitHub), 2026-02-10 · accessed 2026-09-23
  8. Otherin_memory.py at python-1.39.3 (filter allowlist before the fix) · Microsoft (GitHub) · accessed 2026-09-24
  9. Patch / releasein_memory.py at python-1.39.4 (fixed version, still uses restricted eval) · Microsoft (GitHub) · accessed 2026-09-24
  10. ResearchWhen prompts become shells: RCE vulnerabilities in AI agent frameworks · Microsoft Security Blog, 2026-05-07 · accessed 2026-09-23

Press brief

In one sentence

The Python version of Semantic Kernel, Microsoft's open-source framework for building AI applications, had a vulnerability: parameters that the AI model fills in for a search feature were run as code. An attacker who manages to get the model to read specially crafted text could take control of the server. Microsoft released the fixed version 1.39.4 in February 2026, and there are currently no public reports of it being exploited.

Quotable line

When an AI model's output turns directly into code, prompt injection is no longer just about making a chatbot say the wrong thing. It's about making the server carry out someone else's commands.

Images

Download the share image (PNG) · Attack flow diagram (downloadable)

Please credit "PlainCVE" and link to this page. Full citation format is under "How to cite" below. Found a factual error? Report it.

How to cite this page

This article is CC BY 4.0. Please keep the attribution and link when republishing.

PlainCVE Team (2026). "Microsoft Semantic Kernel (Python) runs InMemoryVectorStore filter conditions as code". PlainCVE. https://plaincve.date/en/vulns/cve-2026-26030-semantic-kernel-filter-rce (accessed YYYY-MM-DD)
BibTeX
@misc{cve202626030semantickernelfilterrce2026,
  title  = {Microsoft Semantic Kernel (Python) runs InMemoryVectorStore filter conditions as code},
  author = {PlainCVE Team},
  year   = {2026},
  howpublished = {PlainCVE},
  url    = {https://plaincve.date/en/vulns/cve-2026-26030-semantic-kernel-filter-rce},
  note   = {Updated 2026-09-24}
}