All vulnerabilities

npm

CVE-2026-110872

Nodemailer: Quadratic (O(n^2)) SMTP client reply parsing lets a malicious server or MITM cause a pre-auth remote denial of service

Severity
Medium 5.9
Published
27 Oct 2026
Last changed
27 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
10.0.10
Exploit chance
0.4% in the next 30 daysHigher than 29% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)Inefficient algorithmic complexity (CWE-407)
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-4g23-2xm8-66gc
Sources
OSV.dev and GitHub

Description

The SMTP client response parser reassembles multiline server replies by appending each continuation line onto a single response-queue entry and re-testing whether that entry is still a partial (continuation) reply on every line. The partial-response test runs str.slice(str.lastIndexOf('\n') + 1) on the growing entry, which forces a full flatten of the entire accumulated string on each line. A malicious or compromised SMTP server (or an on-path attacker on a plaintext or pre-STARTTLS hop) that streams continuation lines and never sends a completion line drives O(n^2) CPU on the single-threaded Node.js event loop before any authentication, freezing the whole process for an attacker-controlled duration.

The invariant that a server cannot cause superlinear client-side work while a reply is being reassembled is violated. In src/smtp-connection/index.ts, _onData splits inbound bytes into lines and, while the last queued entry is a continuation reply, concatenates each new line onto that…

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
nodemailernpm · osv:npm:nodemailer
  • From 3.0.0 before 10.0.10

About nodemailer

Weekly downloads (npm)
40,472,572npm, 23 Nov 2026

References