CVE-2025-62380
JavaScript vulnerability analysis and mitigation

Overview

Mailgen, a Node.js package for generating responsive HTML emails, contains an HTML injection vulnerability (CVE-2025-62380) in versions through 2.0.31. The vulnerability affects the generatePlaintext method when processing user-generated content. The issue was discovered and reported by Edoardo Ottavianelli (@edoardottt) and was disclosed on October 15, 2025 (GitHub Advisory).

Technical details

The vulnerability exists in the Mailgen.generatePlaintext function where the HTML sanitization process fails to properly handle Unicode-encoded characters within HTML tags. The function attempts to strip HTML tags using a regular expression (/<(.| )+?>/g) and then decodes HTML entities, but tags containing certain Unicode line separator characters bypass the sanitization. These encoded tags are later decoded into valid HTML content, allowing unexpected HTML to remain in output intended to be plaintext (GitHub Advisory, Miggo).

Impact

When the plaintext message is rendered in a context where HTML is interpreted, the vulnerability can lead to Cross-Site Scripting (XSS) attacks. This could potentially result in arbitrary code execution in the victim's browser, enabling attackers to steal secrets or sensitive information contained in the email messages (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in version 2.0.32 of Mailgen. Users should upgrade to this version or later to address the security issue (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66456CRITICAL9.1
  • JavaScriptJavaScript
  • elysia
NoYesDec 09, 2025
CVE-2025-66457HIGH7.5
  • JavaScriptJavaScript
  • elysia
NoYesDec 09, 2025
CVE-2025-65849MEDIUM6.9
  • JavaScriptJavaScript
  • altcha
NoNoDec 08, 2025
CVE-2025-66202MEDIUM6.5
  • JavaScriptJavaScript
  • astro
NoYesDec 09, 2025
CVE-2025-14284MEDIUM5.1
  • JavaScriptJavaScript
  • @tiptap/extension-link
NoYesDec 09, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management