CVE-2025-62380 Details
Description
mailgen is a Node.js package that generates responsive HTML e-mails for sending transactional mail. Mailgen versions through 2.0.31 contain an HTML injection vulnerability in plaintext emails generated with the generatePlaintext method when user generated content is supplied. The plaintext generation code attempts to strip HTML tags using a regular expression and then decodes HTML entities, but tags that include certain Unicode line separator characters are not matched and removed. These encoded tags are later decoded into valid HTML content, allowing unexpected HTML to remain in output intended to be plaintext. Projects are affected if they call Mailgen.generatePlaintext with untrusted input and then render or otherwise process the returned string in a context where HTML is interpreted. This can lead to execution of attacker supplied script in the victim’s browser. Version 2.0.32 fixes the issue.
A vulnerability allowing HTML injection has been identified in the Mailgen Node.js package, specifically in versions through 2.0.31. This issue arises in plaintext emails generated by the 'generatePlaintext' method when user-generated content is included. The vulnerability occurs because the plaintext generation process attempts to remove HTML tags using a regular expression and then decodes HTML entities. However, tags containing certain Unicode line separator characters are not properly stripped, allowing HTML to persist in output meant to be plaintext. Projects that use Mailgen's 'generatePlaintext' with untrusted input and then process the output in a context that interprets HTML may be at risk, potentially leading to the execution of injected scripts in the recipient's browser.
Users can upgrade to Mailgen version 2.0.32 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 15, 2025CISA-ADP
Assessed Oct 15, 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/7a791a424ff3a3f7783f8750919f1e98639924a8 | [email protected] | Source CodeVendor |
| https://github.com/eladnava/mailgen/security/advisories/GHSA-q4w9-x3rv-4c8j | [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
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 8, 2026 | CVE Translated | [email protected] |
| Sep 30, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Oct 15, 2025 | New CVE Received | [email protected] |
Volerion