{"id":"EUVD-2025-34682","revision":null,"records":[{"revision":"1cecc70a3d8143d2beffd1427845e597","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2025-62380","aliases":[],"title":"Mailgen has HTML Injection and XSS Filter Bypass in Plaintext Emails","description":"mailgen is a Node.js package that generates responsive HTML e-mails for sending transactional mail. Mailgen versions through 2.0.31 contain an HTML injection vulnerability in plaintext emails generated with the generatePlaintext method when user generated content is supplied. The plaintext generation code attempts to strip HTML tags using a regular expression and then decodes HTML entities, but tags that include certain Unicode line separator characters are not matched and removed. These encoded tags are later decoded into valid HTML content, allowing unexpected HTML to remain in output intended to be plaintext. Projects are affected if they call Mailgen.generatePlaintext with untrusted input and then render or otherwise process the returned string in a context where HTML is interpreted. This can lead to execution of attacker supplied script in the victim’s browser. Version 2.0.32 fixes the issue.","state":0,"publishedAt":"2025-10-15T16:52:39.407+00:00","modifiedAt":"2025-10-15T17:15:16.972+00:00","affected":[{"ecosystem":"Vendor product","name":"mailgen","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"eladnava\",\n                    \"product\": \"mailgen\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 2.0.32\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","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,"severity":"LOW"}],"references":["https://github.com/eladnava/mailgen/security/advisories/GHSA-q4w9-x3rv-4c8j","https://github.com/eladnava/mailgen/commit/7a791a424ff3a3f7783f8750919f1e98639924a8"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2025-62380","license":"CVE Program Terms of Use","key":"cve-program:CVE-2025-62380","identifiers":["CVE-2025-62380"]},"retained":false,"historicalAffected":[]},{"revision":"298a48de09434edc81f79552ebbcbf74","observedAt":"2026-11-11T04:30:16.282+00:00","statement":{"source":"euvd","id":"EUVD-2025-34682","aliases":["CVE-2025-62380","GHSA-q4w9-x3rv-4c8j"],"title":"mailgen is a Node.js package that generates responsive HTML e-mails for sending transactional mail. Mailgen versions through 2.0.31 contain an HTML injection vulnerability in plaintext emails generated with the generatePlaintext method when…","description":"mailgen is a Node.js package that generates responsive HTML e-mails for sending transactional mail. Mailgen versions through 2.0.31 contain an HTML injection vulnerability in plaintext emails generated with the generatePlaintext method when user generated content is supplied. The plaintext generation code attempts to strip HTML tags using a regular expression and then decodes HTML entities, but tags that include certain Unicode line separator characters are not matched and removed. These encoded tags are later decoded into valid HTML content, allowing unexpected HTML to remain in output intended to be plaintext. Projects are affected if they call Mailgen.generatePlaintext with untrusted input and then render or otherwise process the returned string in a context where HTML is interpreted. This can lead to execution of attacker supplied script in the victim’s browser. Version 2.0.32 fixes the issue.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","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,"severity":null}],"references":["https://github.com/eladnava/mailgen/security/advisories/GHSA-q4w9-x3rv-4c8j","https://github.com/eladnava/mailgen/commit/7a791a424ff3a3f7783f8750919f1e98639924a8"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-34682","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 15, 2025, 4:52:39 PM","dateUpdated":"Oct 15, 2025, 5:15:16 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2025-34682","identifiers":["EUVD-2025-34682","CVE-2025-62380","GHSA-q4w9-x3rv-4c8j"]},"retained":false,"historicalAffected":[]},{"revision":"2d421c59498640d09840b05cb26c65a8","observedAt":"2026-10-25T03:17:29.935+00:00","statement":{"source":"nvd","id":"CVE-2025-62380","aliases":[],"title":"mailgen is a Node.js package that generates responsive HTML e-mails for sending transactional mail. Mailgen versions through 2.0.31 contain an HTML injection vulnerability in plaintext emails generated with the generatePlaintext method when…","description":"mailgen is a Node.js package that generates responsive HTML e-mails for sending transactional mail. Mailgen versions through 2.0.31 contain an HTML injection vulnerability in plaintext emails generated with the generatePlaintext method when user generated content is supplied. The plaintext generation code attempts to strip HTML tags using a regular expression and then decodes HTML entities, but tags that include certain Unicode line separator characters are not matched and removed. These encoded tags are later decoded into valid HTML content, allowing unexpected HTML to remain in output intended to be plaintext. Projects are affected if they call Mailgen.generatePlaintext with untrusted input and then render or otherwise process the returned string in a context where HTML is interpreted. This can lead to execution of attacker supplied script in the victim’s browser. Version 2.0.32 fixes the issue.","state":0,"publishedAt":"2025-10-15T17:16:00.48+00:00","modifiedAt":"2026-10-08T11:10:00.25+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":2.9,"severity":"LOW"}],"references":["https://github.com/eladnava/mailgen/commit/7a791a424ff3a3f7783f8750919f1e98639924a8","https://github.com/eladnava/mailgen/security/advisories/GHSA-q4w9-x3rv-4c8j"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2025-62380","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-79"],"productCriteria":[],"sourceDates":{"published":"2025-10-15T17:16:00.480","lastModified":"2026-10-08T11:10:00.250"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2025-62380","identifiers":["CVE-2025-62380"]},"retained":false,"historicalAffected":[]},{"revision":"776eb204ccb44faaa3911e282261b12c","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-q4w9-x3rv-4c8j","aliases":["CVE-2025-62380"],"title":"Mailgen has HTML Injection and XSS Filter Bypass in Plaintext Emails","description":"### Summary\n\nAn HTML injection vulnerability in plaintext emails generated by Mailgen has been discovered. Projecta are affected if the `Mailgen.generatePlaintext(email)` method is used and passed in user-generated content. The issue was discovered and reported by Edoardo Ottavianelli (@edoardottt).\n\n### Details\n\nThe following function (inside index.js) is intended to strip all HTML content to produce a plaintext string.\n\n```javascript\n// Plaintext text e-mail generator\nMailgen.prototype.generatePlaintext = function (params) {\n    // Plaintext theme not cached?\n    if (!this.cachedPlaintextTheme) {\n        throw new Error('An error was encountered while loading the plaintext theme.');\n    }\n    \n    // Parse email params and get back an object with data to inject\n    var ejsParams = this.parseParams(params);\n\n    // Render the plaintext theme with ejs, injecting the data accordingly\n    var output = ejs.render(this.cachedPlaintextTheme, ejsParams);\n\n    // Definition of the <br /> tag as a regex pattern\n    var breakTag = /(?:\\<br\\s*\\/?\\>)/g;\n    var breakTagPattern = new RegExp(breakTag);\n\n    // Check the plaintext for html break tag, maintains backwards compatiblity\n    if (breakTagPattern.test(this.cachedPlaintextTheme)) {\n        // Strip all linebreaks from the rendered plaintext\n        output = output.replace(/(?:\\r\\n|\\r|\\n)/g, '');\n\n        // Replace html break tags with linebreaks\n        output = output.replace(breakTag, '\\n');\n\n        // Remove plaintext theme indentation (tabs or spaces in the beginning of each line)\n        output = output.replace(/^(?: |\\t)*/gm, \"\");\n    }\n\n    // Decode HTML entities such as &copy;\n    output = he.decode(output);\n\n    // Strip all HTML tags from plaintext output\n    output = output.replace(/<(.|\\n)+?>/g, '');\n\n    // All done!\n    return output;\n};\n```\n\nThe process fails because it searches for HTML tags and attempts to strip them from the input. However, if the unicode encoded characters are present inside HTML tags, they are not removed. These encoded tags are then decoded later and become valid HTML content, which can lead to XSS vulnerabilities.\n\nA valid payload is: `<img src=x onerror=alert(1)\\u2028>`.\n\n### PoC\n\n```javascript\nvar Mailgen = require('mailgen');\n\n// Configure mailgen by setting a theme and your product info\nvar mailGenerator = new Mailgen({\n    theme: 'default',\n    product: {\n        // Appears in header & footer of e-mails\n        name: 'Mailgen',\n        link: 'https://mailgen.js/'\n        // Optional product logo\n        // logo: 'https://mailgen.js/img/logo.png'\n    }\n});\n\nvar email = {\n    body: {\n        name: 'John <img src=x onerror=alert(document.body.innerHTML)\\u2028> Appleseed',\n        intro: 'Welcome to Mailgen! We\\'re very excited to have you on board.',\n        action: {\n            instructions: 'To get started with Mailgen, please click here:',\n            button: {\n                color: '#22BC66', // Optional action button color\n                text: 'Confirm your account',\n                link: 'secret-link'\n            }\n        },\n        outro: 'Need help, or have questions? Just reply to this email, we\\'d love to help.'\n    }\n};\n\nvar emailText = mailGenerator.generatePlaintext(email);\nrequire('fs').writeFileSync('emailText.html', emailText, 'utf8');\n```\n\n**Resulting output file (emailText.html)**:\n\n```HTML\nHi John <img src=x onerror=alert(document.body.innerHTML)\n> Appleseed,\n\nWelcome to Mailgen! We're very excited to have you on board.        \n\nTo get started with Mailgen, please click here:        \nsecret-link            \n\nNeed help, or have questions? Just reply to this email, we'd love to help.        \n\nYours truly,  \nMailgen\n\n© 2025 Mailgen. All rights reserved.\n```\n\n### Impact\n\nDepending on the context/environment where the plaintext message is used, if HTML is rendered and executed can result in arbitrary code execution in the browser of the victim (potentially stealing secrets or sensitive information contained in the message).\n\n### Credits\n\nEdoardo Ottavianelli (@edoardottt)","state":0,"publishedAt":"2025-10-15T19:29:36+00:00","modifiedAt":"2025-10-16T07:57:36.093474+00:00","affected":[{"ecosystem":"npm","name":"mailgen","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2.0.32"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"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","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"LOW"}],"references":["https://github.com/eladnava/mailgen/security/advisories/GHSA-q4w9-x3rv-4c8j","https://nvd.nist.gov/vuln/detail/CVE-2025-62380","https://github.com/eladnava/mailgen/commit/7a791a424ff3a3f7783f8750919f1e98639924a8","https://github.com/eladnava/mailgen"],"sourceUrl":"https://github.com/advisories/GHSA-q4w9-x3rv-4c8j","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-q4w9-x3rv-4c8j","identifiers":["GHSA-q4w9-x3rv-4c8j","CVE-2025-62380"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-11T09:57:43.3267414+00:00","complete":true,"records":1779,"lastAttemptAt":"2026-11-11T09:57:43.3267414+00:00","lastSuccessAt":"2026-11-11T09:57:46.3036784+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:57:46.3038639+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-de3b77103708811b6494d2ff7c979037d73ae579742cd1649a5c765137ae5083-f19af5e22c13aa688d23829fe96c281d0deaf6cf2f8cee6748f54f5a479127b2","complete":true,"records":424021,"lastAttemptAt":"2026-11-11T09:57:38.9264743+00:00","lastSuccessAt":"2026-11-11T09:25:54.5258746+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:57:38.9264743+00:00","snapshotPublishedAt":"2026-11-11T09:25:28+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-f581ef223ba240a69a1abcff00ee4876","complete":true,"records":13758,"lastAttemptAt":"2026-11-11T09:58:42.1822037+00:00","lastSuccessAt":"2026-11-11T09:58:42.065+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:58:42.065+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13812,"expectedIdentifiers":13812,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-11T09:57:43.3267414+00:00","complete":true,"records":1097,"lastAttemptAt":"2026-11-11T09:57:43.3267414+00:00","lastSuccessAt":"2026-11-11T09:57:52.273871+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:57:52.273872+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-304fa97221904da4b3dcd306fc4b8a4b","complete":true,"records":13752,"lastAttemptAt":"2026-11-11T09:57:53.9573384+00:00","lastSuccessAt":"2026-11-11T09:26:01.454+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:26:01.454+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13812,"expectedIdentifiers":13812,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-3562b6c78fd1bd0f0b55daf66a0926ae24f65e462df7f6d928caad458fc696bf","complete":true,"records":9947,"lastAttemptAt":"2026-11-11T09:57:42.4406155+00:00","lastSuccessAt":"2026-11-11T04:27:43.6877707+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:57:42.4406155+00:00","snapshotPublishedAt":"2026-11-11T03:32:46+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-456002455e0ab94bb92c95476d4e6d175c104cd594749982afd96c893728ecbc","complete":true,"records":2010,"lastAttemptAt":"2026-11-11T09:57:39.9639043+00:00","lastSuccessAt":"2026-11-11T02:36:58.1276999+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:57:39.9639043+00:00","snapshotPublishedAt":"2026-11-11T01:17:51+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-2bc186fc4a8179fd66d765079d475b0b8e3af9f89b57dcc310e7773ded48b2cc","complete":true,"records":3088,"lastAttemptAt":"2026-11-11T09:57:43.196106+00:00","lastSuccessAt":"2026-11-11T09:25:59.9234294+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:57:43.196106+00:00","snapshotPublishedAt":"2026-11-11T09:02:55+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-085e065fc9050ae18408f7e722c39653aeb186872334d7b3ec1fcafb7ed43d25","complete":true,"records":231665,"lastAttemptAt":"2026-11-11T09:57:41.7897107+00:00","lastSuccessAt":"2026-11-11T08:27:45.2700102+00:00","error":null,"lastVerifiedAt":"2026-11-11T09:57:41.7897107+00:00","snapshotPublishedAt":"2026-11-11T07:32:59+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}