HTML Injection Vulnerability in Mailgen by Elad Nava
CVE-2025-59526
2.7LOW
What is CVE-2025-59526?
The Mailgen package for Node.js, used to generate responsive HTML emails for transactional purposes, has a vulnerability that allows HTML injection in plaintext emails. This occurs when user-generated content is passed to the Mailgen.generatePlaintext(email) method before version 2.0.30. If exploited, this weakness can enable attackers to insert arbitrary HTML into the generated emails, potentially allowing for phishing or other malicious activities. Users are advised to upgrade to version 2.0.30 or later, or alternatively, to apply a workaround by stripping all HTML tags from the content before processing it with Mailgen.
Affected Version(s)
mailgen < 2.0.30