{"cve":"CVE-2025-62366","nvd":{"published":"2025-10-14T16:15:42.170","modified":"2026-10-08T11:10:00.250","status":"Deferred","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.","cvss_v4":{"vector":"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","score":2.9},"cvss_v3":null,"cwes":["CWE-79"],"references":["https://github.com/eladnava/mailgen/commit/7279a983481d05c51aa451e86146f98aaa42fee9","https://github.com/eladnava/mailgen/security/advisories/GHSA-xw6r-chmh-vpmj"],"products":[],"source":"nvd","synced_at":"2026-10-19T22:11:26.888974865+00:00"},"epss":{"cve":"CVE-2025-62366","score":0.00428,"percentile":0.36766,"date":"2026-10-25"},"kev":null,"osv":[{"id":"GHSA-xw6r-chmh-vpmj","url":"https://osv.dev/vulnerability/GHSA-xw6r-chmh-vpmj","summary":"Mailgen has HTML Injection and XSS Filter Bypass in Plaintext Emails","modified":"2025-10-14T20:42:34.366080Z","packages":[{"ecosystem":"npm","name":"mailgen","purl":"pkg:npm/mailgen","ranges":["<2.0.31"],"fixed":["2.0.31"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}