CVE-2025-59526
JavaScript vulnerability analysis and mitigation

Overview

The vulnerability CVE-2025-59526 affects mailgen, a Node.js package that generates responsive HTML e-mails for sending transactional mail. The vulnerability was discovered and reported by Edoardo Ottavianelli (@edoardottt) and was disclosed on September 22, 2025. It specifically affects versions prior to 2.0.30 and involves an HTML injection vulnerability in plaintext e-mails generated by the package (GitHub Advisory, NVD).

Technical details

The vulnerability is classified as an HTML injection issue (CWE-79: Improper Neutralization of Input During Web Page Generation) that occurs when using the Mailgen.generatePlaintext(email) method with user-generated content. The CVSS v4.0 score is 2.7 (LOW) with the vector string CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:L/E:U (NVD).

Impact

Projects that use the Mailgen.generatePlaintext(email) method and pass user-generated content are affected by this vulnerability. The vulnerability could potentially allow HTML injection in plaintext emails, which might lead to security issues when processing or displaying the generated content (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 2.0.30 of the mailgen package. For users who cannot immediately update, a workaround is available: strip all HTML tags before passing any content into Mailgen.generatePlaintext(email). The fix was implemented in commit 741a019, which modified the HTML tag stripping regex to handle multi-line content (GitHub Commit, 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-2026-23744CRITICAL9.8
  • JavaScriptJavaScript
  • @mcpjam/inspector
NoYesJan 16, 2026
CVE-2026-23735HIGH8.7
  • JavaScriptJavaScript
  • graphql-modules
NoYesJan 16, 2026
GHSA-gw32-9rmw-qwwwHIGH8.4
  • JavaScriptJavaScript
  • svelte
NoYesJan 16, 2026
CVE-2026-23745HIGH8.2
  • JavaScriptJavaScript
  • tar
NoYesJan 16, 2026
GHSA-38cw-85xc-xr9xMEDIUM6.8
  • JavaScriptJavaScript
  • @veramo/data-store
NoYesJan 16, 2026

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