MantisBT Vulnerable to Stored XSS in File Download
MantisBT is vulnerable to stored cross-site scripting (XSS) via file_download.php by using the `show_inline=1` parameter with a valid CSRF token to upload a crafted XHTML attachment referencing a JavaScript attachment, leading to arbitrary code execution.
MantisBT, a web-based bug tracking system, is vulnerable to a stored cross-site scripting (XSS) attack. The vulnerability exists in the file_download.php script. By exploiting this flaw, an attacker can inject malicious JavaScript code into the application, which will be executed in the context of other users’ browsers when they access the affected functionality. The vulnerability is triggered when processing file downloads, specifically when the show_inline=1 parameter is used in conjunction with a valid file_show_inline_token CSRF token. This allows an attacker to upload a crafted XHTML attachment that references a JavaScript attachment. The vulnerability affects MantisBT versions 2.28.1 and earlier. This can lead to account takeover, sensitive data leakage, and other malicious activities.
Attack Chain
- Attacker authenticates to MantisBT as a user with permissions to upload attachments.
- Attacker crafts a malicious JavaScript file (e.g.,
evil.js) containing the XSS payload. - Attacker crafts a malicious XHTML file (e.g.,
evil.xhtml) that includes the JavaScript file using<script src="evil.js"></script>. - Attacker obtains a valid CSRF token for the
file_show_inline_tokenparameter. - Attacker uploads both the
evil.jsandevil.xhtmlfiles as attachments to a MantisBT issue. - Attacker crafts a request to
file_download.phpwith theshow_inline=1parameter, the valid CSRF token, and the file IDs of the uploadedevil.xhtmlattachment. - A victim user clicks a link (or is redirected) to the crafted
file_download.phpURL. - The server serves the
evil.xhtmlfile inline, which executes the embeddedevil.jsJavaScript in the victim’s browser, allowing the attacker to perform actions on behalf of the victim.
Impact
Successful exploitation of this vulnerability allows an attacker to execute arbitrary JavaScript code in the context of a victim’s browser. This can lead to a variety of malicious activities, including session hijacking, defacement of the MantisBT interface, theft of sensitive information, or further exploitation of the MantisBT server or the victim’s machine. Given the nature of bug tracking systems, successful exploitation could impact multiple users within an organization, potentially leading to widespread compromise.
Recommendation
- Apply the patch provided by MantisBT (26647b2e68ba30b9d7987d4e03d7a16416684bc2) to remediate the vulnerability.
- Deploy the Sigma rule “Detect MantisBT XSS via file_download.php” to identify potential exploitation attempts.
- Monitor web server logs for requests to
file_download.phpwith theshow_inline=1parameter and potentially malicious content in the request.
Detection coverage 2
Detect MantisBT XSS via file_download.php
highDetects CVE-2026-44657 exploitation - Suspicious access to file_download.php with show_inline parameter, potentially indicative of XSS attempts.
Detect MantisBT Suspicious Attachment Uploads
mediumDetects suspicious attachment uploads to MantisBT with potential XSS vectors. This looks for XHTML files referencing JavaScript files which are common XSS attack vectors.
Detection queries are available on the platform. Get full rules →