Skip to content
Security Alerts

CVE-2026-82854: SMTP Command Injection in Nodemailer

Nodemailer before 8.0.4 concatenates an unsanitized envelope.size value into the SMTP MAIL FROM command. CRLF characters in that value allow arbitrary SMTP protocol commands to be injected...

Summary

ParameterValue
CVE IDCVE-2026-82854
Alert SourceGitHub Advisory - Critical vulnerability
CVE Year2026
Publication Date2026-08-31
VendorNodemailer
ProductNodemailer (npm), versions before 8.0.4
CVSS Score9.8 (Critical)
EPSS ScoreNo data
CISA KEVNo
RansomwareNot confirmed

Vulnerability Description

Source: NVD / GitHub Advisory

Nodemailer before version 8.0.4 is vulnerable to SMTP command injection through the unsanitized envelope.size parameter.

The mechanism is straightforward: when an application passes a custom envelope object with a size property to sendMail(), that value is concatenated into the SMTP MAIL FROM command (as SIZE=...) without stripping control characters. If the value contains CRLF characters, an attacker terminates the current protocol command and appends their own.

Exploitation requires the application to pass envelope.size derived from external input. That limits the reach — not every application builds its own envelope object — but where it does, the vector is fully remote and requires no authentication against the library itself.

One consequence is sending messages outside the application’s control through the organisation’s authenticated SMTP server — borrowing a trusted sender reputation for phishing.

Fix: Nodemailer 8.0.4.

Required Actions

  1. Upgrade Nodemailer to 8.0.4 or later. Check transitive dependencies too — Nodemailer is often pulled in by higher-level frameworks and libraries, not only directly.
  2. Review the code for sendMail() calls using a custom envelope object. If the size value derives from user input, treat that as a priority.
  3. Run npm audit across your Node.js projects to inventory versions across the application portfolio.
  4. Check SMTP server logs for unusual command sequences or messages sent to recipients outside the expected range.

Who Is Affected?

The vulnerability affects Node.js applications using the Nodemailer library in versions older than 8.0.4.

Nodemailer is the default way to send mail from Node.js applications — transactional email, notifications, password resets and order confirmations. In practice that means virtually every web application built in this ecosystem: online stores, SaaS platforms, customer portals and internal systems.

Given that scale of use, treat this as an inventory task rather than a point fix: the question is not “do we use Nodemailer” but “in how many applications, and at which versions”.

Sources


Need help securing your systems? nFlo team offers vulnerability management and web application penetration testing services. Contact us.

Learn More

Share:

Talk to an expert

Have questions about this topic? Get in touch with our specialist.

Sales Representative
Grzegorz Gnych

Grzegorz Gnych

Sales Representative

Response within 24 hours
Free consultation
Individual approach

Providing your phone number will speed up contact.

Want to Reduce IT Risk and Costs?

Book a free consultation - we respond within 24h

Response in 24h Free quote No obligations

Or download free guide:

Download NIS2 Checklist