Update dependency nodemailer to v8 [SECURITY]#79
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
Conversation
d09d522 to
becffe8
Compare
21b0dba to
ed771bc
Compare
0b6c69e to
056299f
Compare
96513d5 to
3a78c26
Compare
a2b2f1a to
5f020f4
Compare
e9c36d7 to
bd5fbf3
Compare
d081c9b to
c101744
Compare
ab9b756 to
885070b
Compare
8e7d30d to
1b5cd6d
Compare
081dae7 to
5256719
Compare
5256719 to
5d35932
Compare
5d35932 to
495e1f2
Compare
9a818a8 to
03be108
Compare
03be108 to
e4e8795
Compare
e4e8795 to
2063414
Compare
c1862b9 to
a13deb7
Compare
a13deb7 to
ed88626
Compare
ed88626 to
a8c1cf5
Compare
0e8a8b2 to
9d88a04
Compare
9d88a04 to
50d7099
Compare
50d7099 to
b2f38ab
Compare
b2f38ab to
25e36b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^6.7.2→^8.0.4GitHub Vulnerability Alerts
CVE-2025-13033
The email parsing library incorrectly handles quoted local-parts containing @. This leads to misrouting of email recipients, where the parser extracts and routes to an unintended domain instead of the RFC-compliant target.
Payload:
"xclow3n@gmail.com x"@​internal.domainUsing the following code to send mail
Running the script and seeing how this mail is parsed according to RFC
But the email is sent to
xclow3n@gmail.comImpact:
Misdelivery / Data leakage: Email is sent to psres.net instead of test.com.
Filter evasion: Logs and anti-spam systems may be bypassed by hiding recipients inside quoted local-parts.
Potential compliance issue: Violates RFC 5321/5322 parsing rules.
Domain based access control bypass in downstream applications using your library to send mails
Recommendations
Fix parser to correctly treat quoted local-parts per RFC 5321/5322.
Add strict validation rejecting local-parts containing embedded @ unless fully compliant with quoting.
CVE-2025-14874
Summary
A DoS can occur that immediately halts the system due to the use of an unsafe function.
Details
According to RFC 5322, nested group structures (a group inside another group) are not allowed. Therefore, in lib/addressparser/index.js, the email address parser performs flattening when nested groups appear, since such input is likely to be abnormal. (If the address is valid, it is added as-is.) In other words, the parser flattens all nested groups and inserts them into the final group list.
However, the code implemented for this flattening process can be exploited by malicious input and triggers DoS
RFC 5322 uses a colon (:) to define a group, and commas (,) are used to separate members within a group.
At the following location in lib/addressparser/index.js:
https://github.com/nodemailer/nodemailer/blob/master/lib/addressparser/index.js#L90
there is code that performs this flattening. The issue occurs when the email address parser attempts to process the following kind of malicious address header:
g0: g1: g2: g3: ... gN: victim@example.com;Because no recursion depth limit is enforced, the parser repeatedly invokes itself in the pattern
addressparser → _handleAddress → addressparser → ...for each nested group. As a result, when an attacker sends a header containing many colons, Nodemailer enters infinite recursion, eventually throwing Maximum call stack size exceeded and causing the process to terminate immediately. Due to the structure of this behavior, no authentication is required, and a single request is enough to shut down the service.
The problematic code section is as follows:
data.groupis expected to contain members separated by commas, but in the attacker’s payload the group contains colon(:)tokens. Because of this, the parser repeatedly triggers recursive calls for each colon, proportional to their number.PoC
As a result, when the colon is repeated beyond a certain threshold, the Node.js process terminates immediately.
Impact
The attacker can achieve the following:
GHSA-c7w3-x93f-qmm8
Summary
When a custom
envelopeobject is passed tosendMail()with asizeproperty containing CRLF characters (\r\n), the value is concatenated directly into the SMTPMAIL FROMcommand without sanitization. This allows injection of arbitrary SMTP commands, includingRCPT TO— silently adding attacker-controlled recipients to outgoing emails.Details
In
lib/smtp-connection/index.js(lines 1161-1162), theenvelope.sizevalue is concatenated into the SMTPMAIL FROMcommand without any CRLF sanitization:This contrasts with other envelope parameters in the same function that ARE properly sanitized:
from,to): validated for[\r\n<>]at lines 1107-1127dsn.ret,dsn.envid,dsn.orcpt): encoded viaencodeXText()at lines 1167-1183The
sizeproperty reaches this code path throughMimeNode.setEnvelope()inlib/mime-node/index.js(lines 854-858), which copies all non-standard envelope properties verbatim:Since
_sendCommand()writes the command string followed by\r\nto the raw TCP socket, a CRLF in thesizevalue terminates theMAIL FROMcommand and starts a new SMTP command.Note: by default, Nodemailer constructs the envelope automatically from the message's
from/tofields and does not includesize. This vulnerability requires the application to explicitly pass a customenvelopeobject with asizeproperty tosendMail().While this limits the attack surface, applications that expose envelope configuration to users are affected.
PoC
ave the following as
poc.jsand run withnode poc.js:Expected output:
The
RCPT TO:<attacker@evil.com>line is injected by the CRLF in thesizefield, silently adding an extra recipient to the email.Impact
This is an SMTP command injection vulnerability. An attacker who can influence the
envelope.sizeproperty in asendMail()call can:RCPT TOcommands, receiving copies of all emails sent through the affected transportRSET, additionalMAIL FROMto send entirely separate emails through the server)The severity is mitigated by the fact that the
envelopeobject must be explicitly provided by the application. Nodemailer's default envelope construction from message headers does not includesize. Applications that pass through user-controlled data to the envelope options (e.g., via API parameters, admin panels, or template configurations) are vulnerable.Affected versions: at least v8.0.3 (current); likely all versions where
envelope.sizeis supported.Release Notes
nodemailer/nodemailer (nodemailer)
v8.0.4Compare Source
Bug Fixes
v8.0.3Compare Source
Bug Fixes
v8.0.2Compare Source
Bug Fixes
v8.0.1Compare Source
Bug Fixes
v8.0.0Compare Source
⚠ BREAKING CHANGES
Bug Fixes
v7.0.13Compare Source
Bug Fixes
v7.0.12Compare Source
Bug Fixes
v7.0.11Compare Source
Bug Fixes
v7.0.10Compare Source
Bug Fixes
v7.0.9Compare Source
Bug Fixes
v7.0.7Compare Source
Bug Fixes
v7.0.6Compare Source
Bug Fixes
v7.0.5Compare Source
Bug Fixes
v7.0.4Compare Source
Bug Fixes
v7.0.3Compare Source
Bug Fixes
v7.0.2Compare Source
Bug Fixes
v7.0.1Compare Source
Bug Fixes
v7.0.0Compare Source
⚠ BREAKING CHANGES
Features
v6.10.1Compare Source
Bug Fixes
v6.10.0Compare Source
Features
Bug Fixes
v6.9.16Compare Source
Bug Fixes
v6.9.15Compare Source
Bug Fixes
v6.9.14Compare Source
Bug Fixes
v6.9.13Compare Source
Bug Fixes
v6.9.12Compare Source
Bug Fixes
v6.9.11Compare Source
Bug Fixes
v6.9.10Compare Source
Bug Fixes
v6.9.9Compare Source
Bug Fixes
v6.9.8Compare Source
Bug Fixes
v6.9.7Compare Source
Bug Fixes
v6.9.6Compare Source
Bug Fixes
v6.9.5Compare Source
Bug Fixes
v6.9.4Compare Source
v6.9.3Compare Source
v6.9.2Compare Source
v6.9.1Compare Source
Bug Fixes
v6.9.0Compare Source
v6.8.0Compare Source
v6.7.8Compare Source
v6.7.7Compare Source
v6.7.6Compare Source
v6.7.5Compare Source
v6.7.4Compare Source
v6.7.3Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.