CVE-2026-138027 Bagel before 2.5.5 Unsandboxed DuckDB SQL Execution via query_messages

Published Updated

Prompt injection of the driving LLM can make Bagel's unsandboxed DuckDB tool read and write files and perform SSRF.

CVSS score

High

7.7/10

CVSS 4.0 · Scored by VulnCheck Breakdown
Exploited in the wild
Not known
Not in CISA's KEV catalogue
Exploit code
None known
No public exploit found
Fix
None listed
No fixed version published
Attack path
Over the internet
No login, a user must click or open something

What is CVE-2026-138027?

CVE-2026-138027 is a high-severity code injection vulnerability in Extelligence-ai Bagel, published on 27 Nov 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-749

How severe is CVE-2026-138027?

CVE-2026-138027 scores 7.7 out of 10 under CVSS 4.0, which is high severity. It was scored by VulnCheck.

Attack vector
Network
Attack complexity
High
Attack requirements
Present
Privileges required
None
User interaction
Passive
Confidentiality
High
Integrity
High
Availability
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

Which versions are affected by CVE-2026-138027?

1 open source package ship an affected version, including bagel-mcp.

An affected version is exposed as installed. No special setting or call is needed.

PackageAffectedFixed in
bagel-mcp PyPI
pkg:pypi/bagel-mcp
All versions2.5.5

How do I fix CVE-2026-138027?

Upgrade each affected package to the fixed version listed for it above. Each package has its own fixed versions.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-138027 being exploited?

There is no known exploitation of CVE-2026-138027 in the wild and no public exploit code.

Sources

Also known as GHSA-xrqm-r82m-j847.

Is CVE-2026-138027 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free