Vulnerability  ·  2026-11-29

Bagel (bagel-mcp) unsandboxed DuckDB SQL execution via read-only query_messages MCP tool

VulnerabilityHigh impactGlobalCVE-2026-138027
Bagel (bagel-mcp) before 2.5.5 exposes unsandboxed DuckDB SQL execution through the read-only-annotated `query_messages` MCP tool, allowing file access and network requests. An attacker who prompt-injects the driving LLM via recorded logs or topics can invoke `read_csv_auto`, `COPY TO`, or the httpfs extension to read and write files and perform server-side request forgery. Published 2026-11-27, CWE-749 (Exposed Unsafe Method), fixed in 2.5.5 (GHSA-xrqm-r82m-j847).
This violates the tool's read-only contract, turning a memory/RAG retrieval MCP tool into an arbitrary file read/write and SSRF primitive. Because the triggering input is attacker-controlled conversation content that the LLM ingests, a single prompt-injection in a multi-user or log-replay context can make the agent read secrets from the host, write files, or reach internal services.
Prompt injection via recorded logs or topics drives the model to call query_messages with DuckDB functions (read_csv_auto, COPY TO, httpfs) to read/write files on the host or reach internal network services.
Extelligence-ai Bagel (bagel-mcp) < 2.5.5
Upgrade bagel-mcp to 2.5.5 or later.
NVD detailBagel source (query.py)
See this in the live feed Explore related AI security and governance findings — updated every morning.
Open the feed →