Bagel MCP server patches rsync argument injection flaw
A flaw in the Bagel agent pipeline let prompt-injected text smuggle rsync options that run commands as the server process, according to the published advisory.
By The Agentic Times ·

A vulnerability in Bagel, an MCP server published by Extelligence-ai, allowed attackers to run commands on the host by feeding malicious text to the language model driving it. The flaw, tracked as CVE-2026-138028, was published in the US National Vulnerability Database on 27 November 2026 and affects all versions of the package, known as bagel-mcp, before 2.5.5.
The problem sits in a pipeline task called RsyncFilesToLocalDirectory, which copies files using rsync, a standard file-synchronisation tool. According to the NVD entry, the task filtered only two rsync options, rejecting values for --quiet and --log-format. Everything else was passed through. That left the door open to rsync's own command-execution options.
The advisory states that attackers who influence the model through prompt-injected content — text planted in data the agent reads, which the model then treats as an instruction — can trigger the run_pipeline function with the -e or --rsh option, or with --rsync-path. Both of those options tell rsync which program to run, so supplying them results in commands being executed as the Bagel server process. In other words, the agent does not need to be tricked into writing a shell command; it only needs to be persuaded to add an extra flag to a file-copy task it was always allowed to perform.
This is a pattern that keeps recurring in agent tooling. A tool is wrapped and exposed to a model with a deny list of dangerous arguments, rather than an allow list of permitted ones. Anything the deny list authors did not think of remains reachable. In this case, according to the NVD description, the deny list covered logging-related options but not the options that spawn a remote shell.
The NVD record points to the vulnerable code in version 2.5.4, in the file bagel_mcp/pipeline/tasks/rsync_files.py, and to a commit and a release that address it. Extelligence-ai published version 2.5.5 as the fixed release, and a security advisory, GHSA-gx2g-3pch-43q5, on the project's GitHub repository. A corresponding advisory has also been published by VulnCheck, which describes the issue as argument injection via rsync pipeline task options. Users of bagel-mcp should move to 2.5.5 or later.
The practical severity depends on where the server runs and what it can reach. Because the injected program runs as the Bagel server process, it inherits whatever credentials, file access and network position that process holds. The advisory does not describe any exploitation in the wild, and no affected users have been named. Neither the NVD entry nor the linked advisories state who reported the issue.
The broader lesson for teams building agent pipelines is that command-line tools have large and poorly bounded interfaces. Rsync, tar, curl, git and others all contain options that execute code or write to arbitrary paths as a documented feature. When those tools are placed behind a model that can be steered by untrusted text, the safe default is to construct the full argument list in code and allow the model to supply only validated values, rather than to accept model-supplied flags and try to filter the dangerous ones out afterwards.
Sources
- nvd.nist.govhttps://nvd.nist.gov/vuln/detail/CVE-2026-138028
