← All advisories

CVE-2026-138027highPrompt injection2026-11-27

CVE-2026-138027 / CVE-2026-138028: Bagel MCP server ran model-supplied DuckDB SQL unsandboxed (file read/write, SSRF) and let rsync options through to command execution (fixed 2.5.5)

Bagel (PyPI bagel-mcp) is an MCP server that lets an AI assistant query robotics, drone and IoT data in plain English. Before 2.5.5 its query_messages tool, annotated as read-only, passed LLM-written SQL straight to DuckDB with external access on, so a prompt injection hidden in recorded logs or topics could make the model read or write files (read_csv_auto, COPY TO) or make network requests via httpfs. A second bug let rsync options such as -e/--rsh or --rsync-path through the rsync pipeline task, giving command execution as the Bagel server process. Both are fixed in 2.5.5.

01.

What it is

CVE-2026-138027 (CWE-749): query_messages, SQL gates and topic_sql tasks handed model-supplied SQL to duckdb.sql() on the main connection, with no sandbox. read_csv_auto, COPY TO and httpfs allowed arbitrary file read/write and server-side request forgery.

CVE-2026-138028 (CWE-88): RsyncFilesToLocalDirectory only rejected --quiet and --log-format values, so run_pipeline could be given -e/--rsh or --rsync-path and run commands as the Bagel process.

Attack path in the CVE records: an attacker who prompt-injects the driving LLM through recorded logs or topic data. The report notes Bagel hosts are often wired to real ROS/MQTT device control.

Fix in 2.5.5 (PR #311, GitHub advisory GHSA-gx2g-3pch-43q5, published 15 November 2026): model SQL and event predicates run on a separate DuckDB connection with external access, extension install/autoload and replacement scans disabled and the configuration locked, and only a single SELECT is accepted; rsync options are an allowlist that rejects -e/--rsh, --rsync-path, file-writing flags and sources starting with '-'.

Affected: bagel-mcp < 2.5.5 (and Docker images before 2.5.5). NVD published both CVEs on 27 November 2026. Reported by Syed Anas Mohiuddin.

02.

How to check

  1. Run pip show bagel-mcp (or check the Docker image tag): anything below 2.5.5 is affected.
  2. If an assistant drove Bagel over data you don't fully control, review DuckDB/Bagel logs for read_csv_auto, COPY, httpfs or ATTACH statements and rsync tasks with -e, --rsh or --rsync-path.
03.

How to fix

  1. Upgrade with pip install -U bagel-mcp (or uvx bagel-mcp@latest) to 2.5.5 or later; Docker users pull the 2.5.5+ images.
  2. Run the server as an unprivileged user without access to secrets or cloud metadata, and keep a human approval step for pipeline runs.
pip show bagel-mcp | grep -i '^version'
pip install -U 'bagel-mcp>=2.5.5'
04.

Sources

More advisories for this tool
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.