{"id":"PYSEC-2026-4095","summary":"MCP Atlassian: Path traversal in upload_attachment allows arbitrary file read (incomplete fix for CVE-2026-27825)","details":"### Summary\n\nThe `confluence_upload_attachment` and `confluence_upload_attachments` MCP tools accept a `file_path` parameter and do not validate that the path is confined to an allowed directory before opening the file. An attacker who can call these tools can read any file accessible to the MCP server process (SSH keys, .env files, API credentials) and exfiltrate it by uploading it to Confluence.\n\nNote: The Jira `upload_attachment` mixin method in `jira/attachments.py` has the same missing validation, but it is NOT registered as an MCP tool in `servers/jira.py` and is therefore not currently reachable via MCP. It should still be patched to prevent future exposure if Jira upload tools are added.\n\nThis is an incomplete fix for CVE-2026-27825. That CVE was patched by adding `validate_safe_path()` to download operations (v0.17.0). The same protection was not applied to upload operations.\n\n### Details\n\n`validate_safe_path()` is imported in both `confluence/attachments.py` and `jira/attachments.py` and is correctly called in all download functions. It is absent from the Confluence upload functions (which are exposed as MCP tools) and from the Jira upload mixin methods (which are not currently registered as MCP tools but should still be patched).\n\n**Download (protected — correctly patched):**\n```python\n# confluence/attachments.py:222-223\nvalidate_safe_path(target_path)  # resolves symlinks + checks is_relative_to(cwd)\n```\n\n**Upload (vulnerable — not patched):**\n```python\n# confluence/attachments.py:64-79 — NO validate_safe_path() call\nif not os.path.isabs(file_path):\n    file_path = os.path.abspath(file_path)  # normalizes but does NOT restrict\n# ...\nfiles = {\"file\": (filename, open(file_path, \"rb\"))}  # opens arbitrary file\n```\n\nSame pattern in `jira/attachments.py:386`.\n\n### Proof of Concept\n\n```python\n# Call via MCP client\nawait session.call_tool(\"confluence_upload_attachment\", {\n    \"content_id\": \"12345\",\n    \"file_path\": \"/home/user/.ssh/id_rsa\"  # absolute path — no traversal needed\n})\n# SSH private key is now a Confluence attachment\n# Retrieve via: confluence_download_attachment or Confluence UI\n```\n\n### Impact\n\nArbitrary file read from the server filesystem. High-value targets: SSH private keys, `.env` files, AWS/GCP credentials, database configuration, source code.\n\n### Fix\n\nAdd `validate_safe_path(file_path)` call in `confluence/attachments.py:upload_attachment()` (reachable via MCP) and `jira/attachments.py:upload_attachment()` (not currently reachable via MCP, but should be patched preventively), consistent with the existing download protection. No changes to `validate_safe_path()` itself are needed.\n\n```python\n# Add after os.path.abspath() call:\ntry:\n    validate_safe_path(file_path)\nexcept ValueError as e:\n    return {\"success\": False, \"error\": str(e)}\n```","aliases":["CVE-2026-77269","GHSA-h7wj-5v37-59r2"],"modified":"2026-10-01T17:45:10.021229475Z","published":"2026-10-01T16:38:35.398718Z","references":[{"type":"WEB","url":"https://github.com/sooperset/mcp-atlassian/security/advisories/GHSA-h7wj-5v37-59r2"},{"type":"WEB","url":"https://github.com/sooperset/mcp-atlassian/pull/1448"},{"type":"WEB","url":"https://github.com/sooperset/mcp-atlassian/commit/b041733473f95119dd539542a43c280737a8e460"},{"type":"PACKAGE","url":"https://github.com/sooperset/mcp-atlassian"},{"type":"WEB","url":"https://github.com/sooperset/mcp-atlassian/releases/tag/v0.22.0"},{"type":"PACKAGE","url":"https://pypi.org/project/mcp-atlassian"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-h7wj-5v37-59r2"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77269"}],"affected":[{"package":{"name":"mcp-atlassian","ecosystem":"PyPI","purl":"pkg:pypi/mcp-atlassian"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.22.0"}]}],"versions":["0.1.1","0.1.10","0.1.11","0.1.12","0.1.13","0.1.14","0.1.15","0.1.16","0.1.2","0.1.3","0.1.4","0.1.6","0.1.7","0.1.8","0.1.9","0.10.0","0.10.1","0.10.2","0.10.3","0.10.4","0.10.5","0.10.6","0.11.0","0.11.1","0.11.10","0.11.11","0.11.12","0.11.2","0.11.2a2","0.11.3","0.11.4","0.11.5","0.11.6","0.11.7","0.11.8","0.11.9","0.12.0","0.13.0","0.13.1","0.14.0","0.14.1","0.14.2","0.14.3","0.15.0","0.16.0","0.16.1","0.17.0","0.18.0","0.18.1","0.19.0","0.2.0","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.20.0","0.20.1","0.21.0","0.21.1","0.3.0","0.3.1","0.4.0","0.5.0","0.6.0","0.6.1","0.6.2","0.6.3","0.6.4","0.6.5","0.7.0","0.7.1","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.9.0"],"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/mcp-atlassian/PYSEC-2026-4095.yaml"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"}]}