# CVE-2026-82854: Nodemailer before 8.0.4 SMTP Command Injection via envelope.size

> Attackers can inject SMTP commands via unsanitized envelope size, potentially adding unauthorized recipients if applications expose this parameter.

- **Severity:** Critical 9.3 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Aug 2026
- **Updated:** 29 Oct 2026
- **Also known as:** CLEANSTART-2026-ME00447, DEBIAN-CVE-2026-82854, ECHO-25c2-edb1-76f4, GHSA-2x76-7hhq-pgvw, GHSA-c7w3-x93f-qmm8, MINI-6hmq-w944-cv5x, MINI-6mrf-vxvv-h8mm, MINI-8mgw-m6hx-pj48, MINI-9w3r-v4vr-qpmr, MINI-c2xw-q462-rr45, MINI-g974-p63q-2pjh, MINI-h777-j92c-3w8r, MINI-hjh9-px7x-9rp6, MINI-hxg7-pc3v-cqvm, MINI-jm4x-6jcp-x8q8, MINI-mc5h-p24q-3686, MINI-mhp3-6rr2-6467, MINI-pf3x-9v54-v88v, MINI-q92j-hh2p-757x, MINI-w6cc-xx9c-p8rf, MINI-wfcc-5jrq-6f9w, UBUNTU-CVE-2026-82854

## What is CVE-2026-82854?

CVE-2026-82854 is a critical command injection vulnerability in nodemailer, published on 31 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Nodemailer before 8.0.4 is vulnerable to SMTP command injection through the unsanitized envelope.size parameter. When an application passes a custom envelope object with a size property containing CRLF characters to sendMail(), the value is concatenated into the SMTP MAIL FROM command (as SIZE=...) without sanitization, allowing injection of arbitrary SMTP commands such as RCPT TO to silently add attacker-controlled recipients. Exploitation requires the application to expose the envelope size to attacker-controlled input, as Nodemailer does not include size in the default auto-constructed envelope.

Weakness: CWE-93 (Improper Neutralization of CRLF Sequences)

## Which versions are affected by CVE-2026-82854?

2 open source packages ship an affected version, including nodemailer.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `nodemailer` | npm | All versions | 8.0.4 |
| `nodemailer` | npm | All versions | 8.0.4 |

## How do I fix CVE-2026-82854?

Upgrade nodemailer to 8.0.4 or later.

## Is CVE-2026-82854 being exploited?

There is no known exploitation of CVE-2026-82854 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-82854 and fix it if it is affected.

What it is: CVE-2026-82854 is a critical command injection vulnerability in nodemailer, published on 31 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-82854 in the wild and no public exploit code.

Affected packages and fixed versions:
- nodemailer (npm): affected all versions; fixed in 8.0.4
- nodemailer (npm): affected all versions; fixed in 8.0.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-82854/ (Markdown: https://insights.sbomify.com/CVE-2026-82854/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-82854
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-82854
- OSV: https://osv.dev/vulnerability/CVE-2026-82854

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-82854/
Summaries are generated and may contain mistakes; the official description above is the record.
