CVE-2025-62366 Details
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.
A vulnerability allowing HTML injection has been identified in Mailgen, a Node.js package for generating responsive HTML emails. This issue affects versions through 2.0.30. The vulnerability arises in plaintext emails created by the 'generatePlaintext' method when user-generated content is included. Although the function is designed to remove HTML tags, it fails to do so if the tags are encoded as HTML entities. These entities are later decoded, resulting in active HTML, such as an image tag with an event handler, in the expected plaintext output. In scenarios where this plaintext is rendered as HTML, it could enable the execution of attacker-controlled JavaScript.
Users can upgrade to Mailgen version 2.0.31 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Oct 14, 2025CISA-ADP
Assessed Oct 14, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/eladnava/mailgen/commit/7279a983481d05c51aa451e86146f98aaa42fee9 | [email protected] | Source CodeVendor |
| https://github.com/eladnava/mailgen/security/advisories/GHSA-xw6r-chmh-vpmj | [email protected] | AdvisoryExploitRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| eladnava mailgen | All versions |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 8, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Oct 14, 2025 | New CVE Received | [email protected] |
Volerion