Executive brief
The smtp-server library, used to create custom SMTP email server applications, is vulnerable to a denial-of-service attack. An unauthenticated remote attacker can crash the server or cause it to become unresponsive by sending a continuous stream of data without newline characters. This exhausts the server's memory, potentially disrupting email delivery services and impacting business operations.
Technical details
A vulnerability in the `SMTPStream._write` method in `lib/smtp-stream.js` allows for uncontrolled resource consumption. The command parser appends incoming TCP chunks to an internal `_remainder` buffer, which is only cleared upon encountering a newline character. By sending a large volume of data without newlines, a remote unauthenticated attacker can cause this buffer to grow indefinitely. This leads to heap exhaustion, significant garbage collection overhead that freezes the Node.js event loop, and eventual process crashes. The issue is resolved in version 3.18.3.
Affected products
- Nodemailer smtp-server < 3.18.3
Timeline
- 2026-05-15: disclosed
- 2026-05-15: advisory
- 2026-05-15: patched: Version 3.18.3 released