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.
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.
How to check
- Run pip show bagel-mcp (or check the Docker image tag): anything below 2.5.5 is affected.
- 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.
How to fix
- 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.
- 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' Sources
- criticalCVE-2026-115555 and 28 more: IBM's Langflow bulletin fixes 29 flaws up to 1.13.0, including 9.9 code execution, MCP tool calls that run custom code without admin rights and an unauthenticated public-flow RCE, upgrade to 1.13.1
- criticalCVE-2026-76092 and CVE-2026-76099: Docker MCP Gateway served its MCP endpoints with no auth in container mode, and its dynamic tools could mount the Docker socket for root on the host (fixed 0.43.1)
- criticalCVE-2026-142487: Joinly's meeting-agent MCP server let any network client import and run subprocess.Popen through the joinly-settings header (fixed 0.5.4)
- criticalCVE-2026-76812 and more: CKAN MCP Server's unauthenticated HTTP mode let anyone bounce sparql_query to the cloud metadata service and read IAM credentials, plus a string of SSRF, injection and DoS fixes (upgrade to 0.4.147)