Skip to main content

bagel-mcp EUVDEUVD-2026-137493

| CVE-2026-138027 HIGH
Exposed Dangerous Method or Function (CWE-749)
2026-11-27 VulnCheck GHSA-xrqm-r82m-j847
7.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Plant prompt injection in recorded logs/topics
  2. Delivery
    Driving LLM ingests poisoned content
  3. Exploit
    LLM invokes query_messages with malicious DuckDB SQL
  4. Execution
    Unsandboxed engine runs read_csv_auto/COPY TO/httpfs
  5. Impact
    Read/write host files and SSRF to internal endpoints

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Dangerous method exposure prevention
Exploitation Conditions

Requires a deployed bagel-mcp instance before 2.5.5 exposing the query_messages MCP tool to a driving LLM, where that LLM ingests attacker-influenced data - recorded logs, topics, or capabilities. The attacker must get prompt-injection content into that data and successfully steer the LLM into calling query_messages with malicious DuckDB SQL; in affected versions the SQL runs on the shared default DuckDB connection with no SELECT-only allowlist and external access/extension install left enabled, so no non-default configuration is needed - the unsandboxed SQL interface is the intended, default behavior. Limiting factors that reduce realistic risk below the raw score: exploitation is gated on a successful indirect prompt injection and on the LLM acting on it (reflected as AC:H, AT:P and UI:P), and the attacker needs a path to insert content into logs/topics the LLM reads; authentication is not required (PR:N).

Impact

This is a genuine but conditional risk rather than a drop-everything emergency. The CVSS 4.0 base score is 7.7 (High) with AV:N and PR:N, which looks alarming, but the same vector qualifies it heavily: AC:H, AT:P and UI:P all signal that exploitation is not a simple one-shot remote hit - it depends on an attacker successfully prompt-injecting the driving LLM and that LLM acting on the poisoned content. The vuln.today decision label is 'this_week' (not act_now/emergency), which is consistent with a serious-but-gated issue. There is no CISA KEV listing, so this is not confirmed actively exploited, and no EPSS probability was supplied in the input, so widespread-exploitation likelihood cannot be quantified here. Countervailing the gating factors, the technical impact is severe (VC:H/VI:H/VA:H: arbitrary file read, file write, and SSRF to internal/cloud-metadata endpoints) and the reporter states they verified a working proof-of-concept locally, so the capability is proven even though no public exploit code has been released. Net: a real priority to patch in normal cadence, elevated for anyone running bagel-mcp with an LLM wired to untrusted logs/topics, but the AC:H/AT:P/UI:P prerequisites make opportunistic mass exploitation unlikely.

Exploit ScenarioDerived

An attacker seeds prompt-injection text into robot/drone/IoT logs or topics that a Bagel MCP server records; when an operator's LLM later analyzes that data, the injected instructions steer it into calling the read-only-annotated query_messages tool with crafted DuckDB SQL. Because the SQL runs unsandboxed, the attacker uses read_csv_auto to read local files (e.g. /etc/passwd), COPY TO to write files, and INSTALL/LOAD httpfs to perform SSRF against internal or cloud-metadata endpoints with results returned in the tool output. The reporter verified this locally with a working PoC; no public exploit code has been published.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 27, 2026

Unsandboxed DuckDB SQL execution in bagel-mcp before 2.5.5 turns the read-only-annotated query_messages MCP tool into an arbitrary file read/write and SSRF primitive that a prompt-injected driving LLM can reach through logs, topics or capabilities it ingests. Exploitation is conditional: it requires an attacker to plant prompt-injection content in data the model reads and to steer it into calling query_messages with malicious SQL (reflected as AC:H, AT:P and UI:P, unauthenticated per PR:N), with no non-default configuration needed since the unsandboxed SQL interface is the intended default behaviour. The result is a genuine but conditional risk rather than a drop-everything emergency, prioritised this_week; there is no CISA KEV entry or confirmed active exploitation, and the disclosure includes a reporter-verified local proof of concept but no published exploit tooling. Fixed in 2.5.5.

RemediationAI

Upgrade to the vendor-released fix, bagel-mcp 2.5.5, via pip install -U bagel-mcp or uvx bagel-mcp@latest, and Docker deployments should pull the 2.5.5 images; the code fix is https://github.com/Extelligence-ai/bagel/commit/cbec958edd9ce105b9005c9e31631b1dc420ee4f (PR #311), and the vendor's SECURITY.md now treats SQL that escapes the new sandbox as in scope, which makes 2.5.5 the only complete remedy. Because the exploitation path runs through a driving LLM that ingests untrusted logs, topics or capabilities, interim exposure reduction means not letting such a model drive query_messages (and the sql gate / topic_sql task paths) until the upgrade is applied, accepting the loss of that query capability; the 2.5.5 rsync hardening in the same advisory also rejects -e/--rsh, --rsync-path and other command-running or file-writing options, so rsync pipeline configs using those flags must be reworked (for an SSH port or key, use a Host entry in ~/.ssh/config instead of -e). Advisory: https://github.com/Extelligence-ai/bagel/security/advisories/GHSA-gx2g-3pch-43q5; additional detail at https://www.vulncheck.com/advisories/bagel-before-2.5.5-unsandboxed-duckdb-sql-execution-via-query-messages. Remediation priority is this_week, not an act-now emergency, given the prompt-injection prerequisite.

Affected VersionsENISA

Bagel 0 <2.5.5

Affected Packages

euvd bagel fix: 2.5.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

bagel-mcp is an MCP (Model Context Protocol) server for robotics/IoT pipelines - the advisory notes deployments are typically wired to real ROS/MQTT device control - and query_messages is documented as an intentional SQL interface whose sql_statement argument is LLM-generated text. Before 2.5.5 that string was passed directly to duckdb.sql() on the shared default DuckDB connection (bagel_mcp/query.py lines 11-29, invoked at server.py line 246 and mirrored in pipeline/gates/sql.py and pipeline/tasks/topic_sql.py), with no SELECT-only allowlist and with DuckDB's external access and extension install/autoload still enabled. This is an instance of CWE-749 (Exposed Dangerous Method or Function) rather than a memory-safety bug: the dangerous capability is the raw SQL surface itself, reachable through a tool the caller believes is read-only. The reporter demonstrated read_csv_auto('/etc/passwd') for file read, COPY ... TO for file write, and INSTALL httpfs / LOAD httpfs to open outbound requests (e.g. to cloud metadata endpoints) whose results are returned in the tool's JSON output. The 2.5.5 fix routes all model- or config-supplied SQL (query_messages statements, sql gates, topic_sql tasks and every event predicate) onto a separate sandboxed DuckDB connection with external access, extension install/autoload and Python replacement scans disabled and configuration locked, accepting only a single SELECT statement, with data supplied as an Arrow stream from the thread's ordinary connection; the same advisory also hardens an rsync pipeline task (CWE-88/CWE-94) by replacing a two-item denylist with a flag allowlist that rejects -e/--rsh, --rsync-path, file-writing flags and sources starting with '-'.

Know when Bagel gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 7.7 HIGH
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
vuln.today AI 7.5 HIGH

Network-delivered and unauthenticated (AV:N/PR:N), but success needs a successful prompt injection and the LLM to act on it (AC:H, UI:R); unsandboxed file read/write and SSRF give C:H/I:H/A:H.

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Technical POC Analysis

Bug class: exposed dangerous method or function (CWE-749 per the CVE record; the upstream advisory GHSA-gx2g-3pch-43q5 files the combined report under CWE-94, "improper control of generation of code"…

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

CVE-2026-138027 in bagel-mcp versions before 2.5.5 allows a maliciously prompted AI model to execute arbitrary SQL, enabling unauthorized file access and network requests. This could lead to data exposure or system compromise, affecting teams relying on the MCP tool for messaging. Leadership should prioritize remediation due to high severity and the conditional but realistic risk of exploitation.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.6%
Top 58% exploitable
Prevalence
Low
niche robotics/drone/IoT MCP analytics server, small deployment footprint
Social Media
3
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy