Nodemailer denial of service in address parser

Severity: low · CVSS 3.1 · Published 2025-12-18

Nodemailer is a popular Node.js library used to send emails from applications. A specially crafted email address header with deeply nested group structures can cause the email parser to enter infinite recursion, crashing the entire Node.js process immediately. No authentication is required—a single malicious email is enough to take down any service using the vulnerable version of Nodemailer.

Technologies: nodemailer (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Low severity, with a CVSS score of 3.1, published 18 December 2025.
Which products and versions are affected?
nodemailer (npm) SEMVER:introduced=0,fixed=7.0.11.
Is there a fix for This vulnerability?
Yes. nodemailer (npm): upgrade to 7.0.11 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run nodemailer (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • nodemailer (npm): upgrade to 7.0.11 or later
    npm install nodemailer@7.0.11

Technical details

The vulnerability exists in the address parser (lib/addressparser/index.js) where nested email group structures are recursively flattened without depth limits. RFC 5322 forbids nested groups, but the parser attempts to handle them by recursively calling itself. An attacker can craft a malicious "To" header with many colons (e.g., "g0: g1: g2: ... gN: victim@example.com;") that triggers unbounded recursion in the _handleAddress function. Each colon in the group causes an additional recursive call, and with sufficient nesting (thousands of levels), the JavaScript call stack overflows, throwing "Maximum call stack size exceeded" and terminating the Node.js process. The attack requires no authentication and succeeds with a single request. The patch adds a recursion depth limit (50 levels maximum) to prevent the attack while preserving legitimate functionality, as legitimate nested groups are extremely rare.

Affected products

  • Nodemailer Project Nodemailer 7.0.10 and earlier

Timeline

  • 2025-11-27: disclosed
  • 2025-11-26: patched: Fix commit b61b9c0 implementing recursion depth limiting
  • 2025-12-18: advisory: GHSA-46j5-6fg5-4gv3 published as duplicate of GHSA-rcmh-qjqh-p98v

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.