<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Csp-Bypass — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/csp-bypass/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Mon, 11 May 2026 19:35:30 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/csp-bypass/feed.xml" rel="self" type="application/rss+xml"/><item><title>MantisBT Content Security Policy Bypass via Attachment Upload (CVE-2026-40597)</title><link>https://feed.craftedsignal.io/briefs/2026-05-mantisbt-csp-bypass/</link><pubDate>Mon, 11 May 2026 19:35:30 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-mantisbt-csp-bypass/</guid><description>A content security policy bypass vulnerability, CVE-2026-40597, exists in MantisBT versions 2.28.1 and earlier, allowing an attacker to bypass the _script-src_ directive by uploading a crafted attachment that, when downloaded, executes as JavaScript due to MIME type sniffing, given a pre-existing XSS / HTML injection vulnerability.</description><content:encoded><![CDATA[<p>MantisBT, a web-based bug tracking system, is vulnerable to a content security policy (CSP) bypass. Specifically, the vulnerability, identified as CVE-2026-40597, allows an attacker to circumvent the CSP&rsquo;s <code>script-src</code> directive. This is achieved by uploading a specially crafted attachment to a MantisBT issue. The vulnerability exists in MantisBT versions 2.28.1 and earlier. An attacker must first inject HTML or XSS. When the attachment is accessed via the <code>file_download.php</code> link, PHP&rsquo;s finfo mechanism incorrectly identifies it as a valid JavaScript MIME type. Because of this, the browser executes the payload within the context of the MantisBT application. This can lead to Cross-Site Scripting (XSS) attacks.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies or exploits an existing XSS or HTML injection vulnerability in MantisBT.</li>
<li>Attacker crafts a malicious payload designed to execute JavaScript code within the browser, and ensures that it will be sniffed as JavaScript by PHP&rsquo;s <code>finfo</code>.</li>
<li>Attacker uploads the crafted payload as an attachment to a MantisBT issue using the standard attachment upload functionality.</li>
<li>MantisBT stores the attachment, associating it with the specific issue.</li>
<li>A user (victim) accesses the issue containing the malicious attachment.</li>
<li>The user clicks the <code>file_download.php</code> link associated with the uploaded attachment.</li>
<li>The webserver serves the attachment via <code>file_download.php</code>. PHP&rsquo;s <code>finfo</code> incorrectly identifies the MIME type of the file as a valid JavaScript MIME type.</li>
<li>The browser imports the attachment as a <code>&lt;script&gt;</code> tag and executes the attacker-controlled JavaScript code within the security context of the MantisBT domain, leading to XSS.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability, in conjunction with a pre-existing XSS or HTML injection, allows an attacker to execute arbitrary JavaScript code in the context of the MantisBT application. This can lead to session hijacking, defacement of the MantisBT interface, sensitive information theft, or other malicious actions performed on behalf of the victim user. Given the wide use of MantisBT in software development and IT support organizations, a successful attack could impact a significant number of users.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade MantisBT to a patched version beyond 2.28.1 as indicated in the advisory (<a href="https://github.com/advisories/GHSA-9c3j-xm6v-j7j3)">https://github.com/advisories/GHSA-9c3j-xm6v-j7j3)</a>.</li>
<li>Deploy the Sigma rule <code>Detect MantisBT CSP Bypass via JavaScript MIME Sniffing</code> to detect attempts to exploit CVE-2026-40597.</li>
<li>Review and harden input validation and output encoding mechanisms to prevent XSS vulnerabilities, which are a prerequisite for exploiting CVE-2026-40597.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>csp-bypass</category><category>xss</category><category>attachment</category><category>mime-sniffing</category></item></channel></rss>