GHSA-9h6g-pr28-7cqp: nodemailer before 6.9.9 ReDoS via attachDataUrls parameter

Published Jan 31, 2024
·
Updated

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.

Other sources

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.

— OSV

Affected Software

1 affected componentFixes available
npm/nodemailer<=6.9.8
6.9.9

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/nodemailer to a version that resolves this vulnerability.

    Fixed in 6.9.9

Event History

Jan 31, 2024
Advisory Published
via GitHub·10:42 PM
Aug 31, 2026
CVE Published
via OSV·08:46 AM
Data Sourced
via OSV·08:46 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of GHSA-9h6g-pr28-7cqp?

The severity of GHSA-9h6g-pr28-7cqp is classified as high due to potential denial of service through event loop blocking.

2

How do I fix GHSA-9h6g-pr28-7cqp?

To fix GHSA-9h6g-pr28-7cqp, upgrade to nodemailer version 6.9.9 or later.

3

What components of nodemailer are affected by GHSA-9h6g-pr28-7cqp?

GHSA-9h6g-pr28-7cqp affects nodemailer versions up to and including 6.9.8 when using attachDataUrls or parsing attachments with embedded files.

4

What type of vulnerability is GHSA-9h6g-pr28-7cqp?

GHSA-9h6g-pr28-7cqp is a Regular Expression Denial of Service (ReDoS) vulnerability.

5

When was GHSA-9h6g-pr28-7cqp disclosed?

GHSA-9h6g-pr28-7cqp was disclosed on October 25, 2023.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203