/

CVE-2026-27825

Severity:

CRITICAL RISK

(9.0)

Path Traversal and Arbitrary File Write in MCP Atlassian

CVE-2026-27825

Analyzed

Vulnerability type

Category:

Path Traversal and Arbitrary File Write

CWE:

CWE-22, CWE-73

Impact:

Arbitrary File Write leading to Remote Code Execution

Severity:

CRITICAL RISK

(9.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

MCP Atlassian's confluence_download_attachment tool allows callers to specify an arbitrary filesystem path for saving Confluence attachments, without enforcing directory boundaries.

If an attacker can invoke this tool and control the attachment content, they can write arbitrary files anywhere the server has permission, which can be leveraged for remote code execution (e.g., by planting cron jobs or overwriting application files).

Affected context

This vulnerability occurs in MCP Atlassian deployments that:

  • Expose the confluence_download_attachment tool to users, agents, or other services, and
  • Allow callers to influence the download_path parameter, and
  • Operate with filesystem write permissions to sensitive locations (e.g., application directories, cron configuration paths, or scripts executed by other components).

The risk is highest when the MCP server runs with elevated privileges or shares a filesystem with other sensitive services, such as system schedulers or production applications.

Exploit preconditions

  • Attack surface: The MCP server interface that exposes the confluence_download_attachment tool.
  • Required access: Ability to call the tool (directly or indirectly via an agent/integration) and access or upload a Confluence attachment.
  • Trigger point: Supplying a download_path pointing to a chosen filesystem location while providing an attachment whose content is controlled by the attacker.
  • Why exploitation is possible:
  • The implementation trusts the download_path parameter and does not restrict it to a safe directory or validate it against traversal or absolute paths.
  • The content written to disk is sourced directly from a Confluence attachment that the attacker can control.
  • Together, this matches CWE-22 (improper path validation) and CWE-73 (external entity controls file path for critical resource).

Why this happens

The core issue is the lack of path validation and directory confinement when writing downloaded attachments to disk.

The tool accepts a user-influenced download_path and writes attachment data to that path without:

  • Normalizing and checking for traversal sequences (e.g., ../),
  • Enforcing a fixed base directory or storage root,
  • Restricting absolute paths or sensitive system locations.

This reflects CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) combined with CWE-73 (External Control of File Name or Path), where an external party dictates both the file location and, through the uploaded attachment, the file contents. The pattern is an unconstrained file-write API that executes in a privileged or shared environment.

Potential impact

  • Attacker-controlled files may be written into system directories (e.g., /etc/cron.d/) leading to code execution via scheduled tasks.
  • Application scripts or configuration files can be overwritten to execute arbitrary code on next load or restart.
  • Log or data files can be poisoned, potentially influencing downstream processing jobs or analytics.
  • Local privilege boundaries may be weakened if the MCP server runs with higher privileges than other components.
  • Integrity of the server's filesystem can be compromised, enabling persistent backdoors or tampering.

General mitigation guidance

Effective mitigation typically focuses on constraining where and how files are written, and reducing the privileges of the writing process:

  • Directory confinement: Restrict all attachment downloads to a dedicated, application-controlled directory that is not executable and not shared with system components or schedulers.
  • Path validation: Normalize and validate requested paths to ensure they remain within the allowed directory; reject absolute paths and any resolved path that escapes the intended root.
  • Non-executable storage: Configure the download directory as non-executable and avoid placing it on paths scanned by schedulers, interpreters, or auto-load mechanisms.
  • Least privilege: Run the MCP server under a user account with minimal filesystem permissions, preventing writes to system and application code directories.
  • Separation of concerns: Avoid using downloaded file locations for code, configuration, or job discovery mechanisms to break the path from file write to code execution.

How teams detect issues like this

Organizations can detect and monitor this class of vulnerability using both code-centric and operational techniques:

  • Static analysis: Flag file-write operations that:
  • Accept user- or tool-controlled paths,
  • Do not enforce a fixed base directory,
  • Fail to normalize and validate the resulting path.
  • Code review indicators:
  • Functions that take a path or filename parameter derived from request or tool input.
  • Direct concatenation of user-provided strings into filesystem paths.
  • Absence of checks ensuring the final path resides under a known safe directory.
  • Policy enforcement:
  • Security checks in CI to prohibit arbitrary path writes without a validation wrapper.
  • Enforcement of "safe file storage" helpers or shared libraries for all download and save operations.
  • Runtime monitoring:
  • File integrity monitoring on sensitive directories (e.g., /etc/, application config or script directories).
  • Logging and anomaly detection for unexpected writes in system or application code paths.

Sources

SourceLink
github.comgithub.com/sooperset/mcp-atlassian/commit/52b9b0997681e87244b20d58034deae89c91631e
github.comgithub.com/sooperset/mcp-atlassian/security/advisories/GHSA-xjgw-4wvw-rgm4

Frequently asked

questions

Yes, if the MCP server is accessible over the network and the attacker can invoke the confluence_download_attachment tool, it can be exploited remotely within the boundaries of the server's filesystem permissions.

An attacker must be able to:

  • Call the confluence_download_attachment tool (directly or via an integrated agent), and
  • Control or supply a Confluence attachment whose contents will be downloaded.

They do not need shell access to the server; the tool call is the primary access vector.

Constrain all file writes to a dedicated, non-executable storage directory and enforce robust path validation that prevents escaping that directory. Use well-reviewed helper functions or middleware that normalize paths and reject absolute or traversal-based locations, instead of handling file paths ad hoc in each tool.

Adopt a consistent file-handling policy that:

  • Treats all external path input as untrusted,
  • Routes all file writes through a centralized API that enforces directory confinement and validation,
  • Applies least-privilege execution for services interacting with the filesystem,
  • Includes automated checks (static analysis and CI policies) to detect direct use of user-controlled paths in file operations.
Find out what's already
exploitable in your codebase.