HTML Injection Vulnerability in Mailgen Node.js Package by Elad Nava
CVE-2025-62380
2.9LOW
What is CVE-2025-62380?
The Mailgen package for Node.js, used for creating responsive HTML emails, is susceptible to an HTML injection vulnerability in the generatePlaintext method. This issue arises when user-generated content includes certain Unicode characters that evade removal by the regular expressions intended to strip HTML tags. Consequently, the output can return unexpected HTML elements within emails expected to be plaintext, leading to potential execution of malicious scripts in recipient browsers. To mitigate this risk, it is crucial to avoid passing untrusted input to Mailgen.generatePlaintext and to upgrade to version 2.0.32, where this vulnerability is addressed.
Affected Version(s)
mailgen < 2.0.32