{"id":"CVE-2026-40597","aliases":["GHSA-9c3j-xm6v-j7j3"],"url":"https://o3.security/vulnerability/CVE-2026-40597","summary":"MantisBT has a Content Security Policy bypass via attachments","details":"Given any pre-existing XSS / HTML injection vulnerability, an attacker can bypass the Content Security Policy's _script-src_ directive by uploading a crafted attachment to any issue that, when accessed via the _file_download.php_ link, will be downloaded with a valid JavaScript MIME type resulting in script execution.\n\nThe uploaded payload must be sniffed as a valid JavaScript MIME type by PHP finfo (see file_create_finfo() API function). Non-JavaScript MIME types will not get imported in a `<script>` tag by the browser, due to response header X-Content-Type-Options being set to _nosniff_, which requires all imported JavaScript files to be a valid JavaScript MIME type.\n\n### Impact\nCross-site scripting\n\n### Patches\n- 9e3bee2e7b909f4e3596985892b8bc8bee9e0bfe\n\n### Workarounds\nNone\n\n### Credits\nThanks to siunam (Tang Cheuk Hei) for discovering and responsibly reporting the issue.","published":"2026-05-22T19:29:46.728Z","modified":"2026-08-12T03:51:41.797641391Z","cvss":null,"epss":{"score":0.00498,"percentile":0.40454,"asOf":"2026-08-15"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"mantisbt/mantisbt","fixedVersion":"2.28.2"}],"fix":{"url":"https://github.com/mantisbt/mantisbt/commit/9e3bee2e7b909f4e3596985892b8bc8bee9e0bfe","label":"mantisbt/mantisbt@9e3bee2"},"references":[{"type":"WEB","url":"https://mantisbt.org/bugs/view.php?id=37016"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40597.json"},{"type":"ADVISORY","url":"https://github.com/mantisbt/mantisbt/security/advisories/GHSA-9c3j-xm6v-j7j3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40597"},{"type":"FIX","url":"https://github.com/mantisbt/mantisbt/commit/9e3bee2e7b909f4e3596985892b8bc8bee9e0bfe"},{"type":"PACKAGE","url":"https://github.com/mantisbt/mantisbt"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:41.797641391Z"}}