Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. nodemailer
  4. ›
  5. GMS-2024-59

GMS-2024-59: nodemailer ReDoS when trying to send a specially crafted email

January 31, 2024

Summary

A ReDoS vulnerability occurs when nodemailer tries to parse img files with the parameter attachDataUrls set, causing the stuck of event loop. Another flaw was found when nodemailer tries to parse an attachments with a embedded file, causing the stuck of event loop.

Details

Regex: /^data:((?:[^;];)(?:[^,])),(.)$/

Path: compile -> getAttachments -> _processDataUrl

Regex: /(<img\b[^>]* src\s*=[\s"’]*)(data:([^;]+);[^"’>\s]+)/

Path: _convertDataImages

PoC

https://gist.github.com/francoatmega/890dd5053375333e40c6fdbcc8c58df6 https://gist.github.com/francoatmega/9aab042b0b24968d7b7039818e8b2698

Impact

ReDoS causes the event loop to stuck a specially crafted evil email can cause this problem.

References

  • gist.github.com/francoatmega/890dd5053375333e40c6fdbcc8c58df6
  • gist.github.com/francoatmega/9aab042b0b24968d7b7039818e8b2698
  • github.com/advisories/GHSA-9h6g-pr28-7cqp
  • github.com/nodemailer/nodemailer/security/advisories/GHSA-9h6g-pr28-7cqp

Code Behaviors & Features

Detect and mitigate GMS-2024-59 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 6.9.8

Solution

Unfortunately, there is no solution available yet.

Source file

npm/nodemailer/GMS-2024-59.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:15 +0000.