# CVE-2024-31204: mailcow Cross-site Scripting Vulnerability via Exception Handler

- Severity: Medium 6.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:A/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 8.25%, higher than 95% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2024-04-04T20:37:45.155Z
- Modified: 2026-06-17T07:27:58.573Z
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

mailcow: dockerized is an open source groupware/email suite based on docker. A security vulnerability has been identified in mailcow affecting versions prior to 2024-04. This vulnerability resides in the exception handling mechanism, specifically when not operating in DEV_MODE. The system saves exception details into a session array without proper sanitization or encoding. These details are later rendered into HTML and executed in a JavaScript block within the user's browser, without adequate escaping of HTML entities. This flaw allows for Cross-Site Scripting (XSS) attacks, where attackers can inject malicious scripts into the admin panel by triggering exceptions with controlled input. The exploitation method involves using any function that might throw an exception with user-controllable argument. This issue can lead to session hijacking and unauthorized administrative actions, posing a significant security risk. Version 2024-04 contains a fix for the issue.

(As written by CVE List.)

## Affected

- mailcow mailcow-dockerized: < 2024-04
- mailcow mailcow_dockerized: before 2024-04
- mailcow mailcow:_dockerized: before 2024-04

## References

- <https://www.sonarsource.com/blog/remote-code-execution-in-mailcow-always-sanitize-error-messages> (exploit, third-party-advisory)
- <https://www.vicarius.io/vsociety/posts/mailcow-with-xss-and-path-traversal-cve-2024-31204-and-cve-2024-30270> (exploit, third-party-advisory)
- <https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-fp6h-63w4-5hcm> (vendor-advisory)

## Sources

- CVE List: [CVE-2024-31204](https://www.cve.org/CVERecord?id=CVE-2024-31204), CVE Terms of Use, modified 2024-12-12
- NVD: [CVE-2024-31204](https://nvd.nist.gov/vuln/detail/CVE-2024-31204), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-31204 · Whole record: https://cve.day/CVE-2024-31204.json · Rebuilt by cve.day 2026-11-25T22:58:38.780Z
