# CVE-2025-62366: Mailgen vulnerable to HTML injection and cross-site scripting via plaintext email generation

- Severity: Low 2.9 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P`
- 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.43%, higher than 38% of CVEs (2026-12-01)
- Published: 2025-10-14T15:23:47.600Z
- Modified: 2026-10-08T11:10:00.250Z
- Also known as: GHSA-xw6r-chmh-vpmj
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

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

## Every score

- GitHub_M: CVSS:4.0 2.9 Low `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P`
- GitHub: CVSS:4.0 Low `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P`

## References

- <https://github.com/eladnava/mailgen/security/advisories/GHSA-xw6r-chmh-vpmj> (web)
- <https://github.com/eladnava/mailgen/commit/7279a983481d05c51aa451e86146f98aaa42fee9> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-62366> (advisory)
- <https://github.com/eladnava/mailgen> (package)

## Sources

- CVE List: [CVE-2025-62366](https://www.cve.org/CVERecord?id=CVE-2025-62366), CVE Terms of Use, modified 2025-10-14
- GitHub Advisory Database: [GHSA-xw6r-chmh-vpmj](https://github.com/advisories/GHSA-xw6r-chmh-vpmj), CC-BY-4.0, modified 2025-10-14
- NVD: [CVE-2025-62366](https://nvd.nist.gov/vuln/detail/CVE-2025-62366), Public domain, modified 2026-10-08

---

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