# CVE-2025-59526: Mailgen: HTML injection vulnerability in plaintext e-mails

- Severity: Low 2.7 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.44%, higher than 39% of CVEs (2026-12-01)
- Published: 2025-09-22T18:03:47.000Z
- Modified: 2026-10-11T20:10:00.200Z
- Also known as: GHSA-j2xj-h7w5-r7vp
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

mailgen is a Node.js package that generates responsive HTML e-mails for sending transactional mail. Prior to version 2.0.30, there is an HTML injection vulnerability in plaintext e-mails generated by Mailgen. Projects are affected if the Mailgen.generatePlaintext(email) method is used and given user-generated content. This vulnerability has been patched in version 2.0.30. A workaround involves stripping all HTML tags before passing any content into Mailgen.generatePlaintext(email).

(As written by CVE List.)

## Affected

- eladnava mailgen: < 2.0.30
- mailgen (npm): before 2.0.30

## Every score

- GitHub_M: CVSS:4.0 2.7 Low `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`
- GitHub: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`

## References

- <https://github.com/eladnava/mailgen/security/advisories/GHSA-j2xj-h7w5-r7vp> (web)
- <https://github.com/eladnava/mailgen/commit/741a0190ddae0f408b22ae3b5f0f4c3f5cf4f11d> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-59526> (advisory)
- <https://github.com/eladnava/mailgen> (package)

## Sources

- CVE List: [CVE-2025-59526](https://www.cve.org/CVERecord?id=CVE-2025-59526), CVE Terms of Use, modified 2025-09-22
- GitHub Advisory Database: [GHSA-j2xj-h7w5-r7vp](https://github.com/advisories/GHSA-j2xj-h7w5-r7vp), CC-BY-4.0, modified 2025-09-23
- NVD: [CVE-2025-59526](https://nvd.nist.gov/vuln/detail/CVE-2025-59526), Public domain, modified 2026-10-11

---

Page: https://cve.day/CVE-2025-59526 · Whole record: https://cve.day/CVE-2025-59526.json · Rebuilt by cve.day 2026-11-25T22:59:05.007Z
