CVE-2026-138027

Bagel before 2.5.5 Unsandboxed DuckDB SQL Execution via query_messages

Published Nov 27, 2026 CVSS 4.0 · 7.7 High EPSS n/a KEV · Not listed
Description
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. Attackers who prompt-inject the driving LLM via recorded logs or topics can invoke read_csv_auto, COPY TO, or httpfs to read and write files and perform server-side request forgery.

Analysis

AI-generated

Technical impact

Bagel (bagel-mcp) before version 2.5.5 allows attackers to execute unsandboxed DuckDB SQL via the read‑only annotated query_messages MCP tool. By injecting crafted prompts into logged interactions or topics, a malicious LLM can cause the server to run commands such as read_csv_auto, COPY TO, or httpfs, which read and write files or perform server‑side request forgery. The vulnerability is a classic database injection flaw, illustrated by CWE‑749, where an attacker can manipulate a database query engine to achieve arbitrary file and network access.

Affected Systems

The affected product is Bagel by Extelligence‑ai, specifically versions earlier than 2.5.5. No further version granularity is supplied; the vulnerability applies to any instance using the query_messages tool in those releases.

Risk and Exploitability

With a CVSS score of 7.7 the vulnerability is considered high severity. EPSS information is not available, so the probability of exploitation cannot be quantified, and it is not listed in the CISA KEV catalog. The most likely attack vector is remote, via injection of malicious prompts into the LLM’s prompt history or topics, which then cause the server to execute the attacker’s DuckDB commands. If successfully exploited an attacker could read or write arbitrary files, perform network requests, and potentially compromise the host system.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to Bagel version 2.5.5 or later to remove the unsandboxed DuckDB SQL execution flaw.
  • Restrict or disable the query_messages MCP tool for untrusted or external users, ensuring only authorized personnel can invoke it.
  • Apply operating‑system and network segmentation so that the DuckDB process has minimal file system and outbound network access.
  • Monitor service logs for anomalous DuckDB query patterns and investigate any suspicious activity promptly.

Generated by OpenCVE AI on November 27, 2026 at 20:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description 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. Attackers who prompt-inject the driving LLM via recorded logs or topics can invoke read_csv_auto, COPY TO, or httpfs to read and write files and perform server-side request forgery.
Title Bagel before 2.5.5 Unsandboxed DuckDB SQL Execution via query_messages
Weaknesses CWE-749
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 7.7, 'vector': 'CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Subscriptions

No data.

Weaknesses
  • CWE-749

    Exposed Dangerous Method or Function

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 27, 2026, 7:15 PM
Reserved
Nov 27, 2026, 4:44 PM
Status
Received
Published
Nov 27, 2026, 8:18 PM
Modified
Nov 27, 2026, 8:18 PM