7.6high
MantisBT has a Content Security Policy bypass via attachments
- Severity
- 7.6high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.50% (higher than 44% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-9c3j-xm6v-j7j3
Description
Mantis Bug Tracker (MantisBT) is an open source issue tracker. In versions 2.28.1 and below, 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. The 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. This issue has been fixed in version 2.28.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| mantisbt mantisbt | < 2.28.2 | CVE List |
| mantisbt/mantisbt (Packagist) | before 2.28.2 | GitHub Advisory Database |
All scores
| GitHub_M | 7.6high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N |
Classification
What each source says
CVE List
Mantis Bug Tracker (MantisBT) is an open source issue tracker. In versions 2.28.1 and below, 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. The 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. This issue has been fixed in version 2.28.2.
GitHub Advisory Database
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.
The 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.
Impact
Cross-site scripting
Patches
- 9e3bee2e7b909f4e3596985892b8bc8bee9e0bfe
Workarounds
None
Credits
Thanks to siunam (Tang Cheuk Hei) for discovering and responsibly reporting the issue.
NVD (es)
Mantis Bug Tracker (MantisBT) es un rastreador de problemas de código abierto. En las versiones 2.28.1 e inferiores, dada cualquier vulnerabilidad preexistente de XSS / inyección HTML, un atacante puede eludir la directiva script-src de la Política de Seguridad de Contenido al subir un archivo adjunto manipulado a cualquier problema que, cuando se acceda a través del enlace file_download.php, se descargará con un tipo MIME de JavaScript válido, lo que resultará en la ejecución del script. La carga útil subida debe ser detectada como un tipo MIME de JavaScript válido por PHP finfo (ver la función API file_create_finfo()). Los tipos MIME que no son de JavaScript no se importarán en una etiqueta <script> por el navegador, debido a que el encabezado de respuesta X-Content-Type-Options está configurado como nosniff, lo que requiere que todos los archivos JavaScript importados sean de un tipo MIME de JavaScript válido. Este problema ha sido solucionado en la versión 2.28.2.
References
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-40597 changed 2026-05-26 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9c3j-xm6v-j7j3 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-40597 changed 2026-07-23 | Public domain |