Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CVE-2025-62366
Summary
Mailgen is a Node.js package that generates responsive HTML emails for sending transactional mail. Mailgen versions through 2.0.30 contain an HTML Injection vulnerability in plaintext emails produced by the "generatePlaintext()" method when user-generated content is supplied. The function attempts to remove HTML tags, but if tags are provided as encoded HTML entities they are not removed and are later decoded, resulting in active HTML (for example, an "<img>" tag with an event handler) in the supposed plaintext output. In contexts where the generated plaintext string is subsequently rendered as HTML, this can allow execution of attacker-controlled JavaScript.
- LOW
- NETWORK
- NONE
- NONE
CWE-79 - Cross Site Scripting
Cross-Site Scripting, commonly referred to as XSS, is the most dominant class of vulnerabilities. It allows an attacker to inject malicious code into a pregnable web application and victimize its users. The exploitation of such a weakness can cause severe issues such as account takeover, and sensitive data exfiltration. Because of the prevalence of XSS vulnerabilities and their high rate of exploitation, it has remained in the OWASP top 10 vulnerabilities for years.
References
Advisory Timeline
- Published