Answers · MCP security
We use the Bagel MCP server (bagel-mcp) to let Claude analyze our robot, drone and IoT logs, and query_messages is marked read-only. Two Bagel CVEs were published on November 27, 2026. Could text inside a recorded log steer the model into reading or writing files on the host or running commands, which version fixes it, and what else should we do?
Last updated
TL;DR: Yes, before bagel-mcp 2.5.5. CVE-2026-138027 (GHSA-xrqm-r82m-j847) says the query_messages tool, annotated read-only, sent the model's SQL straight to DuckDB on the shared connection with no sandbox, so a query could read files with read_csv_auto, write them with COPY ... TO, or load the httpfs extension and make requests to internal addresses such as a cloud metadata service. CVE-2026-138028 (GHSA-7xxf-5gcm-m2mv) says the rsync pipeline task blocked only two options, so -e, --rsh or --rsync-path could run commands as the Bagel server process. Both have a CVSS 3.1 score of 7.5 and need the model to be steered, for example by prompt-injected text in a recorded log or topic. Bagel's own advisory GHSA-gx2g-3pch-43q5 and the fix in pull request 311 shipped on November 15, 2026 in 2.5.5; PyPI listed 2.5.6 as current on November 29. The GitHub advisory entries and CVEs only appeared on November 27, so scanners may have just started flagging older installs. Upgrade, and treat the read-only label as a hint to the client, not a sandbox.
What should I check, step by step?
1. Check the bagel-mcp version everywhere it runs (pip, uvx and Docker images). Anything before 2.5.5 is affected; upgrade to the current release (2.5.6 on PyPI on November 29, 2026) and pull the new Docker images.
- Run Bagel as a user that can read only the log folders it needs, with no write access elsewhere and no cloud credentials in its environment.
- Block outbound network access from the Bagel host or container except what it really needs, so a query that tries to fetch an internal address or a metadata service has nowhere to go.
- Review pipeline configs for rsync tasks and remove any options you don't recognise, especially -e, --rsh and --rsync-path.
- Treat recorded logs, topic names and device messages as untrusted input to the model. If a host is wired to real ROS or MQTT device control, require a human to approve tool calls that change anything.
- If an older version was ever connected to a model reading outside data, check the host for new or changed files and unexpected outbound requests since then.
- Keep a dated record of the version, the pipeline configs and the network rules you run, so you can show what was exposed and when it changed.
What did CVE-2026-138027 let Bagel's query_messages tool do?
Bagel lets a model ask plain-English questions about robotics, drone and IoT data over MCP. Its query_messages tool is designed to take SQL written by the model, and it carries a read-only annotation. Before 2.5.5 that SQL went straight to DuckDB on the shared default connection, with no SELECT-only check and external access left on.
- Bagel's advisory describes what that allowed: reading any file the server process can read with read_csv_auto, writing files with COPY ... TO, and running INSTALL httpfs and LOAD httpfs to make requests to internal endpoints, with the results returned in the tool's own output. The same pattern was in the sql pipeline gate and the topic_sql task.
- The attack path in the advisory is prompt injection: text in a log, topic or capability the model reads steers it into calling query_messages with a malicious statement. Nobody has to reach the server directly, which is why the CVSS vector lists user interaction rather than a network login.
How did CVE-2026-138028 turn a Bagel rsync option into a command?
Bagel's rsync pipeline task built its command as rsync, then the configured options, then the source and a temporary folder. The options check only refused --quiet and --log-format.
- rsync's -e or --rsh option names the program to use as the transport, and --rsync-path names the program to run on the other side, so either one could run an arbitrary command as the Bagel server process. GitHub's advisory database entry says a model influenced by prompt-injected content could trigger run_pipeline with those options.
- Bagel's advisory points out why this matters more than usual: the project's hosts are often wired to real ROS or MQTT device control, so a command run there may reach physical equipment.
What did bagel-mcp 2.5.5 change, and why wasn't the read-only label enough?
Pull request 311, released in 2.5.5 on November 15, 2026, runs model SQL, sql gates, topic_sql tasks and event predicates on a separate DuckDB connection with external access, extension install and autoload, and Python replacement scans turned off, and its configuration locked. Statements must be a single SELECT. The rsync options are now an allowlist; -e, --rsh, --rsync-path and file-writing flags are refused, as is a source that starts with a dash.
- A read-only annotation in MCP is a hint for the client about what a tool is meant to do. It doesn't stop the server from doing something else with the input. Here the database engine itself could read files, write files and open network connections, so the fix had to switch those abilities off where the SQL runs.
- The GitHub advisory entries and CVE numbers were published on November 27, 2026, twelve days after the fix. If a scanner only now flags an old Bagel install, the fix has been available since mid-November.
How do I ask Rightshold about this (free, no key)?
Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “After upgrading Bagel and locking down its host, record a receipt with a hash of the versions, pipeline configs and network rules we now run, so we can show what changed and when.”
{
"tool": "record_action",
"arguments": {
"action_type": "security.config_change",
"outcome": "success",
"occurred_at": "2026-11-29T20:00:00Z",
"client_event_id": "bagel:cve-2026-138027:hardening",
"summary": "bagel-mcp upgraded to 2.5.6 on all hosts and Docker images; Bagel runs as a user limited to the log folders; outbound network blocked except required hosts; rsync task options reviewed; host checked for new files and outbound requests",
"action_sha256": "<sha256 of the exported pipeline configs, version list and network rules>"
}
}- Needs your API key (or accept_terms:true once to open a free account; the key comes back once). It returns a ledger-committed receipt of what you submitted and when, kept outside the Bagel host.
- It doesn't scan Bagel, read your logs or check your network rules. It shows the files you hashed existed at that time and haven't changed since.
Rightshold isn't affiliated with Bagel or Extelligence. Details are from GitHub's advisory database entries GHSA-xrqm-r82m-j847 (CVE-2026-138027) and GHSA-7xxf-5gcm-m2mv (CVE-2026-138028), Bagel's repository advisory GHSA-gx2g-3pch-43q5 and pull request 311, with release dates from PyPI, all read November 29, 2026. Advisories get updated; confirm affected and fixed versions on the linked pages.
What are the sources?
- GitHub Advisory Database: GHSA-xrqm-r82m-j847 / CVE-2026-138027, Bagel unsandboxed DuckDB SQL through the read-only query_messages tool
- GitHub Advisory Database: GHSA-7xxf-5gcm-m2mv / CVE-2026-138028, Bagel rsync pipeline task argument injection
- Bagel security advisory GHSA-gx2g-3pch-43q5: unsandboxed DuckDB SQL execution and rsync command injection, fixed in 2.5.5
- Bagel pull request 311: run model SQL and predicates in a DuckDB sandbox; allowlist rsync options
- bagel-mcp on PyPI (release history)
Related
- Can an MCP tool marked read-only write files (AWS Pricing MCP Server CVE-2026-126816)?
- How to restrict an MCP database tool to read-only queries
- How to stop prompt injection in fetched web or file content from triggering MCP write tools
- How to block SSRF and path traversal in MCP tool URL arguments and resource templates
Not legal advice. JSON · Markdown · All answers
Get a free API key in one call
No card and no email needed. 100 free credits; the license and policy checks stay free without a key.
curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_... # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
-H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'
