CVE-2026-77258: MCP Atlassian: Arbitrary file read/exfiltration via upload_attachment missing validate_safe_path()
The Confluence `upload_attachment` method in mcp-atlassian below 0.22.0 skips `validate_safe_path()`, so an MCP client, or an attacker prompt-injecting the agent, can upload any file the server can read to a Confluence page. Upgrade to 0.22.0.
Published Sep 22, 2026 · Analysis Oct 22, 2026
What an attacker can do
In confluence/attachments.py, the two download methods call validate_safe_path() before writing (around lines 223 and 272). The upload method, lines 62 to 79, does not. It converts a relative path to absolute, checks os.path.exists(), takes the basename and calls _upload_attachment_direct(). The validator is already imported in that file; it was just never added to this path.
An MCP call such as confluence_upload_attachment with file_path set to /etc/passwd reads the file and attaches it to the chosen page. The reporter confirmed on mcp-atlassian 0.21.1 that the upload source contains no validator call while the download methods do.
The attacker needs the ability to call the tool: a connected agent, another MCP client, or a prompt injection that steers the agent. The attacker also needs a page to attach to. What leaves the machine is any file the server process can read, such as SSH keys, AWS credentials, .env files and application secrets. It lands on a Confluence instance that other users can open.
Who is affected
mcp-atlassian below 0.22.0 with the Confluence tools enabled. Jira-only setups are covered by the sibling advisories.
pip show mcp-atlassianIf you launch it with uvx or from a container image, read the pinned version in your MCP client config or compose file.
mcp-atlassian
- Ecosystem
- PyPI
- Affected
- < 0.22.0
- Fixed in
- 0.22.0
- Check
pip show mcp-atlassian
How to fix it
Upgrade to 0.22.0:
pip install --upgrade mcp-atlassian==0.22.0The reporter's suggested fix was to call validate_safe_path(file_path) before the existence check in upload_attachment, matching the download methods. The fix ships in pull request 1448. The advisory lists no workaround.
How to tell if you were hit
Check Confluence pages for attachments uploaded by the MCP service account that you do not recognise, particularly files named after credentials, keys or environment dumps. Page history and the Confluence audit log show who attached what and when. In MCP logs, search for confluence_upload_attachment calls with an absolute file_path outside your intended upload directory. Beam's record of agent MCP tool calls can tie such a call to an agent session.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
The upload_attachment method in confluence/attachments.py reads and uploads arbitrary local files to Confluence without calling validate_safe_path(). Both download methods (download_attachment at line 223, download_content_attachments at line 272) correctly call validate_safe_path() before writing files, but the upload path at lines 35-79 skips this check entirely.
An AI agent connected via MCP (or an attacker influencing that agent through prompt injection) can read any file on the host and exfiltrate it by uploading it as a Confluence page attachment.
Vulnerable Code
File: src/mcp_atlassian/confluence/attachments.py, lines 62-79
# No validate_safe_path() call anywhere in this method
if not os.path.isabs(file_path):
file_path = os.path.abspath(file_path)
if not os.path.exists(file_path):
return {"success": False, "error": f"File not found: {file_path}"}
filename = os.path.basename(file_path)
attachment = self._upload_attachment_direct(
content_id, file_path, filename, comment, minor_edit
)The validate_safe_path function is already imported at line 9 of the same file, and used in the download methods. It was just not added to the upload path.
Proof of Concept
Tested with mcp-atlassian 0.21.1 on Python 3.11 (EC2, Amazon Linux 2023).
import inspect
from mcp_atlassian.confluence.attachments import AttachmentsMixin
# Confirm: no validate_safe_path in upload
source = inspect.getsource(AttachmentsMixin.upload_attachment)
assert "validate_safe_path" not in source # passes
# Confirm: validate_safe_path IS in downloads
assert "validate_safe_path" in inspect.getsource(AttachmentsMixin.download_attachment) # passes
assert "validate_safe_path" in inspect.getsource(AttachmentsMixin.download_content_attachments) # passesAn MCP tool call like this reads /etc/passwd and uploads it to Confluence:
{"tool": "confluence_upload_attachment", "arguments": {"content_id": "123456", "file_path": "/etc/passwd"}}Impact
Exfiltration of any file readable by the MCP server process: SSH keys, AWS credentials, .env files, /etc/passwd, application secrets. Data leaves the local machine and lands on a remote Confluence instance accessible to other users.
Suggested Fix
Add validate_safe_path(file_path) before the os.path.exists() check in upload_attachment, matching the existing pattern in the download methods. The function is already imported.
Questions
- Which method contains the bug?
upload_attachmentinsrc/mcp_atlassian/confluence/attachments.py. It opens the caller's path after an existence check but never callsvalidate_safe_path().- Why do the download methods not have the same problem?
They call
validate_safe_path()before writing a file. The upload method was missed when that function was added.- Is version 0.21.1 vulnerable?
Yes. The reporter tested 0.21.1, and every release below 0.22.0 is listed as vulnerable.
- Does it need user interaction?
No user click is needed. The caller needs a path to invoke the upload tool and a Confluence page that the configured account can write to.
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 entriesCVE-2026-77361
obsidian-tc : Symlink read-ACL scope bypass via lexical path checks
medium4.7Oct 23, 2026CVE-2026-114126
Storybook dev server vulnerable to code injection from the local network
high8.7Oct 22, 2026CVE-2026-113731
djust: Arbitrary absolute-path file read in the find_handlers_for_template MCP tool
low3.3Oct 21, 2026CVE-2026-114125
Storybook: Missing origin validation in Storybook preview allows code injection from malicious websites
critical9.4Oct 21, 2026CVE-2026-111770
MCP TypeScript server SDK: Shared transport or server instances delivered one HTTP client's messages to another
high7.7Oct 20, 2026GHSA-953h-535j-jg2v
agent-router: MCP session resume does not verify the embedded anti-hijacking subject; default Helm seed makes session IDs forgeable
medium6.8Oct 19, 2026
