CVE 2.9 LOW

Mailgen vulnerable to HTML injection and cross-site scripting via plaintext email generation_CVE-2025-62366

2.9 / 10
LOW
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P

Description

mailgen is a Node.js package that generates responsive HTML e-mails 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. Versions 2.0.31 and later contain a fix. No known workarounds exist.

Basic Information

ID CVE-2025-62366
Source GitHub_M
Published Oct 14, 2025 at 15:23
Modified Oct 14, 2025 at 16:07

Affected Product

Vendor eladnava
Product mailgen
Version < 2.0.31
Affected Versions eladnava mailgen < 2.0.31

CWE Classification

References

💭 Join the Security Discussion

🔒 Your email address will not be published. Required fields are marked *

⚠️ Please be respectful and constructive in your comments. Security discussions should remain professional.