vulnerableVerifiedAGT-2026-0192
mcp-atlassian: MCP Atlassian: MCP HTTP Client Server-Local File Exfiltration via Unvalidated Attachment Upload Path
A real bug in otherwise honest software. Check your version against the affected range below.
GHSA-wv8v-v4c5-v75j · CVE-2026-77246 · PYSEC-2026-4104
Summary
The `mcp-atlassian` server exposes an MCP tool (`confluence_upload_attachment` and the Jira attachment variant) that accepts an arbitrary server-side file path and opens it for upload without any path validation. When the server is deployed in HTTP transport mode (`streamable-http` or `sse`), a remote, unauthenticated attacker can supply attacker-controlled Atlassian service headers (`X-Atlassian-Confluence-Url` / `X-Atlassian-Confluence-Personal-Token`) to redirect the upload to an attacker-controlled endpoint, then pass an arbitrary `file_path` (e.g. `/etc/passwd`, `~/.env`, SSH private keys, cloud credentials) to exfiltrate any file readable by the server process. No prior account, session token, or `Authorization` header is required. The vulnerability was confirmed through both static code analysis (Phase 1) and a live Docker-based proof-of-concept (Phase 2).
---
Details
**Data flow (source → sink)**
| Step | Location | Role | |------|----------|------| | 1 | `src/mcp_atlassian/servers/main.py:498-504` | Middleware extracts `X-Atlassian-Confluence-Url` and `X-Atlassian-Confluence-Personal-Token` from incoming HTTP request headers. | | 2 | `src/mcp_atlassian/servers/main.py:584-595` | When no `Authorization` header is present but service headers are, `user_atlassian_auth_type` is set to `"pat"`, effectively bypassing authentication requirements. | | 3 | `src/mcp_atlassian/utils/urls.py:97-104` | `validate_url_for_ssrf` blocks only `localhost`, RFC 1918 private ranges, and a small set of metadata hostnames. An attacker-controlled public domain or an allow-listed Docker container hostname (`MCP_ALLOWED_URL_DOMAINS`) passes this check. | | 4 | `src/mcp_atlassian/servers/dependencies.py:544-545` | The attacker-controlled URL is injected directly as `url=` into `ConfluenceConfig`, constructing a `ConfluenceFetcher` pointed at the attacker's server. | | 5 | `src/mcp_atlassian/servers/confluence.py:1358-1361` | The MCP tool argument `file_path` is forwarded to `confluence_fetcher.upload_attachment()` without any sanitization. | | 6 | `src/mcp_atlassian/confluence/attachments.py:64-79` | The path is converted to an absolute path via `os.path.abspath()` and checked for existence only. `validate_safe_path()` — already used on download paths — is **never called** here, leaving no directory restriction in place. | | 7 | `src/mcp_atlassian/confluence/attachments.py:477` | **Sink**: `files = {"file": (filename, open(file_path, "rb"))}` — the file is opened and sent as multipart to the attacker's server. | | 8 | `src/mcp_atlassian/jira/attachments.py:374-386` | Parallel Jira sink: same `os.path.abspath()` pattern, no `validate_safe_path`, then `open(file_path, "rb")`. |
**Key code evidence**
```python src/mcp_atlassian/confluence/attachments.py 64: if not os.path.isabs(file_path): 65: file_path = os.path.abspath(file_path) 68: if not os.path.exists(file_path): 77: filename = os.path.basename(file_path) 477: files = {"file": (filename, open(file_path, "rb"))} # ← sink ```
```python src/mcp_atlassian/jira/attachments.py 374: if not os.path.isabs(file_path): 375: file_path = os.path.abspath(file_path) 386: with open(file_path, "rb") as file: # ← sink 387: attachment = self.jira.add_attachment( ```
**Why `validate_safe_path` is absent**: The function exists in the codebase and is correctly applied to download/read operations, but it was not applied to the upload path. This asymmetry means an attacker can read any file the server process can access, even though the intent was clearly to restrict path access.
**Default configuration enables the attack**: `READ_ONLY_MODE` defaults to `false`, making write tools (including attachment upload) active by default. HTTP transport is a first-class, documented production deployment mode (README, Helm chart, multi-tenant header-auth design).
**Recommended remediation**
```diff --- a/src/mcp_atlassian/confluence/attachments.py +++ b/src/mcp_
Imported from OSV GHSA-wv8v-v4c5-v75j.
Affected
- PyPI:mcp-atlassian
- < 0.22.0 (fixed in 0.22.0)
Field marks
- Kind
- mcp server
- Reported by
- osv-import
Sources
- osv.dev https://osv.dev/vulnerability/GHSA-wv8v-v4c5-v75j
- github.com https://github.com/sooperset/mcp-atlassian/security/advisories/GHSA-…
- github.com https://github.com/sooperset/mcp-atlassian/pull/1448
- github.com https://github.com/sooperset/mcp-atlassian/commit/b041733473f95119dd…
- github.com https://github.com/sooperset/mcp-atlassian
- github.com https://github.com/sooperset/mcp-atlassian/releases/tag/v0.22.0
Wrong or outdated? Open an issue or PR against corpus/entries/AGT-2026-0192.json.