Skip to content

← Actionable
Low, CVSS 2.3amended

Nodemailer has SMTP command injection due to unsanitized envelope.size parameter

CVE-2026-82854GHSA-c7w3-x93f-qmm8

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (nodemailer 8.0.4), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS 4.0
2.3 · CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N · score source
EPSS
  • CVE-2026-82854: 1.98% estimated exploitation activity in the next 30 days; percentile 80.51 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary When a custom envelope object is passed to sendMail() with a size property containing CRLF characters (\r\n), the value is concatenated directly into the SMTP MAIL FROM command without sanitization. This allows injection of arbitrary SMTP commands, including RCPT TO — silently adding attacker-controlled recipients to outgoing emails. Details In lib/smtp-connection/index.js (lines 1161-1162), the envelope.size value is concatenated into the SMTP MAIL FROM command without any CRLF sanitization: This contrasts with other envelope parameters in the same function that ARE properly sanitized: - Addresses (from, to): validated for [\r\n<] at lines 1107-1127 - DSN parameters (dsn.ret, dsn.envid, dsn.orcpt): encoded via encodeXText() at lines 1167-1183 The size property reaches this code path through MimeNode.setEnvelope() in lib/mime-node/index.js (lines 854-858), which copies all non-standard envelope properties verbatim: Since sendCommand() writes the command string followed by…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 3 · amended ·

    Amended from ghsa record GHSA-c7w3-x93f-qmm8

  2. Revision 2 · amended ·

    Reviewed OSV alias/range/CVSS4 correction; package source scopes and original publication preserved. No customer finding resolved.

  3. Revision 1 · created ·

    Published from osv record GHSA-c7w3-x93f-qmm8

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-82854

Advisory: Nodemailer has SMTP command injection due to unsanitized `envelope.size` parameter
IDs: CVE-2026-82854, GHSA-c7w3-x93f-qmm8
Record: https://patchnext.com/advisories/cve-2026-82854 (revision 3, source checked 26 Oct 2026, 12:47 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Low (CVSS 2.3)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: nodemailer 8.0.4. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm nodemailer: affected < 8.0.4; fixed in 8.0.4

## Suggested inspection (read-only)
- `npm ls nodemailer --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on nodemailer.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-c7w3-x93f-qmm8 (OSV record GHSA-c7w3-x93f-qmm8 lists affected ranges: npm nodemailer >=0 <8.0.4 (fixed))
- Verified: https://github.com/advisories/GHSA-c7w3-x93f-qmm8 (GitHub-reviewed advisory GHSA-c7w3-x93f-qmm8 lists affected ranges: npm nodemailer >=0 <8.0.4)

Commands are suggestions: review each one before running it.

Loading voting…