Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-45800 Overview
CVE-2024-45800 is a mutation cross-site scripting (mXSS) vulnerability in SnappyMail, an open source web-based email client. The flaw resides in the cleanHtml() function, which sanitizes HTML and CSS content in email messages. The function accepts too many invalid HTML elements, allowing attackers to craft malformed markup that browsers subsequently repair into valid, executable markup. A motivated attacker can leverage this behavior to inject JavaScript into rendered emails. The vulnerability is categorized under CWE-79 (Improper Neutralization of Input During Web Page Generation).
Critical Impact
Attackers can inject JavaScript via crafted email HTML, potentially leaking data through the image proxy or executing attacks against local services such as http://localhost:5000/.
Affected Products
- SnappyMail web-based email client versions prior to v2.38.0
- Deployments relying on the default cleanHtml() sanitizer without the "Security mXSS" extension
- Instances exposing the image proxy endpoint to untrusted email content
Discovery Timeline
- 2024-09-16 - CVE-2024-45800 published to the National Vulnerability Database (NVD)
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-45800
Vulnerability Analysis
The vulnerability stems from permissive HTML parsing inside the cleanHtml() routine located in dev/Common/Html.js. SnappyMail's sanitizer allows HTML elements that are not part of the valid HTML specification. When the sanitized output reaches the browser, the rendering engine attempts to normalize the malformed markup. During this normalization, the browser can transform benign-looking tags into executable constructs, producing a mutation XSS condition.
The default Content Security Policy (CSP) limits direct script execution, which reduces the practical impact of the injection. However, attackers can still abuse the image proxy to send authenticated requests to arbitrary URLs loaded through the client, enabling data leakage from endpoints such as http://localhost:5000/leak. A secondary exploitation path involves linking to JavaScript attachments by iterating email UIDs, though the 64-bit UID space (1 to 18446744073709551615) makes this attack impractical at scale.
Root Cause
The root cause is incomplete allowlisting in the HTML sanitization logic. cleanHtml() fails to remove unsupported HTML elements before output, leaving the browser's error-recovery parser to reinterpret attacker-controlled markup. This mismatch between the sanitizer's parse tree and the browser's parse tree creates the mXSS primitive.
Attack Vector
Exploitation requires an attacker to send a crafted email containing invalid HTML markup to a SnappyMail user. The victim must open the email in the web client, satisfying the user interaction requirement. Once rendered, the browser rewrites the broken markup into valid HTML that includes attacker-controlled JavaScript or resource loads routed through the SnappyMail proxy.
No verified public proof-of-concept code has been released for this issue. Refer to the SnappyMail security advisory GHSA-2rq7-79vp-ffxm and the upstream fix commit for technical specifics.
Detection Methods for CVE-2024-45800
Indicators of Compromise
- Inbound emails containing unusual or invalid HTML tags, unexpected nesting, or malformed attribute structures intended to trigger browser markup repair.
- Outbound requests from the SnappyMail image proxy to internal hostnames such as localhost, 127.0.0.1, or RFC1918 addresses.
- Email messages linking to numerous sequential UIDs or referencing attachments with JavaScript MIME types.
Detection Strategies
- Inspect message bodies at the mail gateway for malformed HTML patterns and uncommon tag combinations typical of mXSS payloads.
- Monitor web server access logs on the SnappyMail host for proxy requests resolving to internal network ranges.
- Alert when the running SnappyMail version is older than v2.38.0 across your inventory.
Monitoring Recommendations
- Enable verbose logging on the SnappyMail image proxy and forward logs to a centralized analytics platform for anomaly detection.
- Correlate browser-side CSP violation reports with inbound email metadata to identify attempted injections.
- Track installation state of the "Security mXSS" extension across all SnappyMail instances that cannot immediately upgrade.
How to Mitigate CVE-2024-45800
Immediate Actions Required
- Upgrade SnappyMail to version v2.38.0 or later, which removes unsupported HTML elements before rendering.
- Install the "Security mXSS" extension from the administration area at /?admin#/packages on any instance that cannot be upgraded immediately.
- Review and tighten the Content Security Policy to restrict script sources and inline execution.
Patch Information
The upstream fix is included in SnappyMail v2.38.0 and later. Review the patch commit cfbc474 and the security advisory GHSA-2rq7-79vp-ffxm for full details on the sanitizer changes.
Workarounds
- Install the "Security mXSS" administrator extension to protect normal message HTML; note that it cannot sanitize encrypted messages or HTML attachments.
- Restrict the SnappyMail image proxy from reaching internal network ranges through firewall rules or egress filtering.
- Disable automatic rendering of remote content and HTML attachments until the upgrade is applied.
# Configuration example: block proxy egress to internal ranges
iptables -A OUTPUT -m owner --uid-owner snappymail -d 127.0.0.0/8 -j REJECT
iptables -A OUTPUT -m owner --uid-owner snappymail -d 10.0.0.0/8 -j REJECT
iptables -A OUTPUT -m owner --uid-owner snappymail -d 172.16.0.0/12 -j REJECT
iptables -A OUTPUT -m owner --uid-owner snappymail -d 192.168.0.0/16 -j REJECT
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

