惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
H
Help Net Security
腾讯CDC
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
D
Docker
V
V2EX
Last Week in AI
Last Week in AI
G
Google Developers Blog
IT之家
IT之家
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
When prompts become shells: the tool registry is the atta...
Michael "Mik · 2026-05-11 · via DEV Community

On May 7, 2026, Microsoft published "When Prompts Become Shells: RCE vulnerabilities in AI agent frameworks" — a retrospective on two Critical (9.9) CVEs in Semantic Kernel that landed in February and were patched within days.

The CVEs are bad. The framing is worse — and worth reading carefully.

The two CVEs

CVE-2026-26030 — eval() on attacker-controlled filter strings

InMemoryVectorStore accepts user-supplied filter expressions and evaluates them. Filter strings are interpolated into a Python expression and executed via eval():

expr = f"' or {user_filter} or '"
result = eval(expr, {"__builtins__": {}}, {})

Enter fullscreen mode Exit fullscreen mode

An AST blocklist exists. It enumerates dangerous node types: Import, Call to known names, attribute access on a denylist. The blocklist was bypassable through undocumented attribute traversal — __name__, load_module, BuiltinImporter — none of which the filter explicitly denied. From there the attacker reaches os.system through the importer machinery without ever hitting an Import node.

Patched: semantic-kernel Python 1.39.4. Three external researchers credited.

CVE-2026-25592 — DownloadFileAsync exposed as a kernel function

In SessionsPythonPlugin, the DownloadFileAsync method was decorated with [KernelFunction]. That single attribute makes a function callable by the LLM as a tool. The method accepts a localFilePath parameter with no canonicalization, no directory allowlist, no validation of any kind.

[KernelFunction]
public async Task DownloadFileAsync(string remoteUrl, string localFilePath)
{
    // No path validation. No scope check. No allowlist.
    await File.WriteAllBytesAsync(localFilePath, content);
}

Enter fullscreen mode Exit fullscreen mode

A prompt that gets the agent to call this tool with localFilePath = "C:\\Windows\\Start Menu\\Programs\\Startup\\malware.exe" writes a file that executes on the next user login. Sandbox escape, host-level persistence, in one tool call.

Patched: Microsoft.SemanticKernel.Plugins.Core 1.71.0. Same three researchers.

Microsoft's load-bearing line

"Vulnerabilities in the AI layer are no longer just a content issue and are an execution risk... because these frameworks act as a ubiquitous foundational layer, a single vulnerability in how they map AI model outputs to system tools carries systemic risk."

That's not throwaway language. They're naming a class.

A registered tool that wraps eval() turns prompt injection into a syscall.

Every agent framework has a tool registry. Every registry maps LLM-generated strings to functions. If any registered function wraps a dangerous primitive — eval, exec, Download*, raw filesystem write — prompt injection is no longer a content problem. It's a scope problem.

What runtime testing catches

Most agent security tools — including the harness I work on (msaleme/red-team-blue-team-agent-fabric) — operate at runtime. They send adversarial prompts, observe what the agent does, and flag deviations from declared behavior. Several tests in that suite map directly to these CVEs:

  • MCP-010: injects path traversal, template injection, and command substitution payloads into tool call arguments. Catches the DownloadFileAsync exploit if you've already invoked the tool.
  • SS-002: scans declared permissions against actual code, fails when exec:none is declared but eval() appears in the body. Catches CVE-26030's pattern if a permission declaration exists.
  • SS-007: enforces sandboxing tiers — a tool wrapping filesystem-write should be Tier-1, never auto-promoted to Tier-3.

Each is useful. None is sufficient.

What runtime testing misses

The upstream cause of both CVEs is structural: a function that could call eval() was registered as a tool. A function that could write any path was decorated with [KernelFunction]. The vulnerability existed at registration time, not at invocation time.

Runtime probes can't see this. They observe the symptom — a bad call happens — and report it after the fact. They don't enumerate the framework's tool registry at load time and traverse the call graph of each registered callable looking for dangerous primitives.

That gap is closer to a Semgrep-over-the-tool-registry rule than a runtime test. Roughly:

rules:
  - id: kernel-function-wraps-dangerous-primitive
    pattern-either:
      - patterns:
          - pattern-inside: |
              [KernelFunction]
              ... $METHOD(...) { ... }
          - pattern-either:
              - pattern: eval(...)
              - pattern: exec(...)
              - pattern: subprocess.$ANY(...)
              - pattern: File.WriteAllBytesAsync(...)
              - pattern: File.WriteAllText(...)
      - patterns:
          - pattern-inside: |
              @kernel_function
              def $METHOD(...): ...
          - pattern-either:
              - pattern: eval(...)
              - pattern: exec(...)
              - pattern: __import__(...)
    message: |
      Function registered as an LLM-callable tool wraps a dangerous primitive.
      The LLM can now invoke this primitive with attacker-influenced arguments.
    severity: ERROR
    languages: [python, csharp]

Enter fullscreen mode Exit fullscreen mode

That rule would have flagged both CVEs in CI before they reached production.

The harder version of this problem is transitive: a registered tool that calls a helper that calls eval(). That requires whole-program analysis. But the first-order cases — direct calls inside the function body — are catchable with the same tooling teams already use for SQL injection and unsafe deserialization.

What I take away

The LLM is not a security boundary. Microsoft says this in their architectural recommendations and they're right. Treat every LLM-generated string as untrusted input at every system call.

The tool registry is the trust boundary. Whether a function is callable by the model is a security decision, not a developer-convenience decision. Every @tool / [KernelFunction] / register_tool() decorator is a capability grant.

Runtime tests catch what registration audits should have caught upstream. Both layers are necessary. Neither is sufficient on its own.

I'm interested in how teams are currently auditing this — whether at PR-time as a Semgrep rule, at registration time as a runtime check, or trust-on-load with downstream gating. Drop a note in the comments if your stack does any of these.


Full test mappings (SS-002, SS-007, MCP-010, MCP-001, HC-5, HC-6, RiskGate) and the cross-link to the constitutional governance layer (CognitiveThoughtEngine/constitutional-agent-governance) are in the GitHub Discussion.