VYPR
Medium severity5.0OSV Advisory· Published Sep 16, 2024· Updated Apr 15, 2026

CVE-2024-45800

CVE-2024-45800

Description

Snappymail is an open source web-based email client. SnappyMail uses the cleanHtml() function to cleanup HTML and CSS in emails. Research discovered that the function has a few bugs which cause an mXSS exploit. Because the function allowed too many (invalid) HTML elements, it was possible (with incorrect markup) to trick the browser to "fix" the broken markup into valid markup. As a result a motivated attacker may be able to inject javascript. However, due to the default Content Security Policy the impact of the exploit is minimal. It could be possible to create an attack which leaks some data when loading images through the proxy. This way it might be possible to use the proxy to attack the local system, like with http://localhost:5000/leak. Another attack could be to load a JavaScript attachment of the email. This is very tricky as the email must link to every possible UID as each email has a unique UID which has a value between 1 and 18446744073709551615 v2.38.0 and up now remove unsupported HTML elements which mitigates the issue. Users are advised to upgrade. Older versions can install an extension named "Security mXSS" as a mitigation. This will be available at the administration area at /?admin#/packages. NOTE: this extension can not "fix" malicious code in encrypted messages or (html) attachments as it can't manipulate the JavaScript code for this. It only protects normal message HTML.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

SnappyMail before 2.38.0 contains an mXSS vulnerability in its cleanHtml() function due to allowing too many invalid HTML elements, enabling data leakage despite a strict CSP.

SnappyMail's cleanHtml() function, used to sanitize HTML and CSS in emails, contained a mutation XSS (mXSS) vulnerability. The function permitted an overly broad set of invalid HTML elements, allowing an attacker to craft malformed markup that the browser would reinterpret into valid, executable HTML. This flaw stemmed from the sanitizer relying on a blacklist of disallowed tags instead of a strict allowlist, and from an incorrect fix for broken Microsoft Outlook/Word styles [1][2].

Exploitation involves sending a specially crafted email containing nested elements such as `, , , and which, after sanitization, are transformed by the browser into a state that can include arbitrary ` tags. These tags can force requests to attacker-controlled servers or, more critically, load JavaScript attachments from the email. The latter attack is particularly challenging because it requires guessing the email's unique UID, a number ranging from 1 to 18446744073709551615 [2].

A successful attack could leak data by making requests through the email proxy to localhost resources (e.g., http://localhost:5000/leak) or achieve XSS if the attacker can load a JavaScript attachment. However, the default Content Security Policy (CSP) significantly reduces the impact, limiting the XSS surface [1][2].

The vulnerability is fixed in SnappyMail v2.38.0, which now removes unsupported HTML elements via an allowlist. Users unable to upgrade on older versions can install the "Security mXSS" extension at /?admin#/packages as a partial mitigation, though this extension cannot protect encrypted messages or HTML attachments [1][2].

AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2
  • The Djmaze/SnappymailOSV2 versions
    1.14.0-djmaze3, 2.12.0, 2.20.5, …+ 1 more
    • (no CPE)range: 1.14.0-djmaze3, 2.12.0, 2.20.5, …
    • (no CPE)range: <2.38.0

Patches

2

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

3

News mentions

0

No linked articles in our index yet.