GitHub advisory · PyPI
MCP Atlassian: Reflected XSS in OAuth Setup Callback Handler
Description
The OAuth 2.0 setup wizard's local callback HTTP server reflects the error query parameter directly into an HTML response without any sanitization or encoding. An attacker can craft a malicious callback URL containing JavaScript in the error parameter that executes in the victim's browser when the setup wizard is running. The server binds to all network interfaces (0.0.0.0), making it accessible from the local network rather than just localhost.
The vulnerability exists in the CallbackHandler class in src/mcp_atlassian/utils/oauth_setup.py.
Step 1 -- Attacker-controlled input enters unsanitized:
At line 63-66, the error query parameter from the URL is read and interpolated into a message string without HTML escaping:
# src/mcp_atlassian/utils/oauth_setup.py:63-66
if "error" in params:
callback_error = params["error"][0]
callback_received = True
self._send_response(f"Authorization failed: {callback_error}")
Step 2 -- Unsanitized input is injected into HTML:
At line 124-125 in _send_response, the message variable (containing the unescaped attacker input) is injected directly into the HTML template via f-string interpolation:
# src/mcp_atlassian/utils/oauth_setup.py:124-125
<div class="message {"success" if status == 200 else "error"}">
<p>{message}</p>
</div>
Step 3 -- Server listens on all interfaces:
At line 167, the callback server binds to all network interfaces, not just localhost:
# src/mcp_atlassian/utils/oauth_setup.py:167
httpd = socketserver.TCPServer(("", port), handler)
This means the XSS is exploitable from any machine that can reach the victim's IP on the callback port (default 8080), not just from the local machine.
Step 4 -- No security headers:
The response at line 84-86 sets Content-type: text/html but does not include Content-Security-Policy, X-Content-Type-Options, or X-XSS-Protection headers:
#…
Manual fix · PyPI
pip install --upgrade "mcp-atlassian>=0.22.0"Sources