fix(deps): update dependency nodemailer to v8 [security]#8341
fix(deps): update dependency nodemailer to v8 [security]#8341backstage-goalie[bot] wants to merge 1 commit into
Conversation
Changed Packages
|
f38e648 to
7a41674
Compare
7a41674 to
dd5f07a
Compare
dd5f07a to
3e5f001
Compare
3e5f001 to
699ff5e
Compare
699ff5e to
b165b71
Compare
b165b71 to
331edc5
Compare
331edc5 to
f8254c8
Compare
f8254c8 to
63438be
Compare
63438be to
bf0923c
Compare
bf0923c to
720b1c4
Compare
720b1c4 to
202d242
Compare
202d242 to
cc280b1
Compare
cc280b1 to
9f4d755
Compare
9f4d755 to
57337af
Compare
57337af to
544d3cc
Compare
544d3cc to
2f2b11b
Compare
2f2b11b to
48ad5bc
Compare
48ad5bc to
b37b639
Compare
b37b639 to
e8173fc
Compare
e8173fc to
89c2bf0
Compare
89c2bf0 to
6c6b13e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '@backstage-community/plugin-feedback-backend': patch | ||
| --- | ||
|
|
||
| Updated dependency `nodemailer` to `^8.0.0`. |
There was a problem hiding this comment.
This changeset says nodemailer was updated to ^8.0.0, but the lockfile resolves nodemailer to 8.0.5 and the security fixes referenced in the PR are in 8.0.5. Please update the changeset text (and ideally the dependency range) to reflect the actual minimum safe version.
| Updated dependency `nodemailer` to `^8.0.0`. | |
| Updated dependency `nodemailer` to `^8.0.5`. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '@backstage-community/plugin-feedback-backend': patch | ||
| --- | ||
|
|
||
| Updated dependency `nodemailer` to `^8.0.0`. |
There was a problem hiding this comment.
This changeset says Nodemailer was updated to ^8.0.0, but the lockfile resolves to 8.0.5 (and the security advisories in the PR description reference fixes in 8.0.4/8.0.5). If you raise the dependency floor to the patched version, please update this changeset text to match.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '@backstage-community/plugin-feedback-backend': patch | ||
| --- | ||
|
|
||
| Updated dependency `nodemailer` to `^8.0.0`. |
There was a problem hiding this comment.
If you adjust the Nodemailer version range to a patched minimum (e.g. ^8.0.5+), please also update this changeset text to match the final dependency spec so the release note remains accurate.
| Updated dependency `nodemailer` to `^8.0.0`. | |
| Updated dependency `nodemailer` to `^8.0.5`. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '@backstage-community/plugin-feedback-backend': patch | ||
| --- | ||
|
|
||
| Updated dependency `nodemailer` to `^8.0.0`. |
There was a problem hiding this comment.
This changeset says nodemailer was updated to ^8.0.0, but that range still includes versions mentioned in the PR description as vulnerable (fixed in 8.0.5+). If you raise the minimum required version in package.json, please also update this changeset text to match the secured minimum version.
| Updated dependency `nodemailer` to `^8.0.0`. | |
| Updated dependency `nodemailer` to `^8.0.5`. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '@backstage-community/plugin-feedback-backend': patch | ||
| --- | ||
|
|
||
| Updated dependency `nodemailer` to `^8.0.0`. |
There was a problem hiding this comment.
This changeset text says Nodemailer was updated to ^8.0.0, but the security advisories described in the PR are fixed starting in later 8.0.x releases. If you bump the dependency minimum to a patched release, update this changeset message accordingly to avoid documenting an unsafe minimum version.
| Updated dependency `nodemailer` to `^8.0.0`. | |
| Updated dependency `nodemailer` to `^8.0.2`. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
Signed-off-by: Renovate Bot <bot@renovateapp.com>
This PR contains the following updates:
^7.0.7→^8.0.0Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Nodemailer has SMTP command injection due to unsanitized
envelope.sizeparameterGHSA-c7w3-x93f-qmm8
More information
Details
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.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Nodemailer Vulnerable to SMTP Command Injection via CRLF in Transport name Option (EHLO/HELO)
GHSA-vvjj-xcjg-gr5g
More information
Details
Summary
Nodemailer versions up to and including 8.0.4 are vulnerable to SMTP command injection via CRLF sequences in the transport
nameconfiguration option. Thenamevalue is used directly in the EHLO/HELO SMTP command without any sanitization for carriage return and line feed characters (\r\n). An attacker who can influence this option can inject arbitrary SMTP commands, enabling unauthorized email sending, email spoofing, and phishing attacks.Details
The vulnerability exists in
lib/smtp-connection/index.js. When establishing an SMTP connection, thenameoption is concatenated directly into the EHLO command:The
_sendCommandmethod writes the string directly to the socket followed by\r\n(line 1082):If the
nameoption contains\r\nsequences, each injected line is interpreted by the SMTP server as a separate command. Unlike theenvelope.fromandenvelope.tofields which are validated for\r\n(line 1107-1119), and unlikeenvelope.sizewhich was recently fixed (GHSA-c7w3-x93f-qmm8) by casting to a number, thenameparameter receives no CRLF sanitization whatsoever.This is distinct from the previously reported GHSA-c7w3-x93f-qmm8 (envelope.size injection) as it affects a different parameter (
namevssize), uses a different injection point (EHLO command vs MAIL FROM command), and occurs at connection initialization rather than during message sending.The
nameoption is also used in HELO (line 1384) and LHLO (line 1333) commands with the same lack of sanitization.PoC
Running this PoC shows the SMTP server receives the injected MAIL FROM, RCPT TO, DATA, and phishing email content as separate SMTP commands before the legitimate email is sent.
Impact
Who is affected: Applications that allow users or external input to configure the
nameSMTP transport option. This includes:What can an attacker do:
The injection occurs at the EHLO stage (before authentication in most SMTP flows), making it particularly dangerous as the injected commands may be processed with the server's trust context.
Recommended fix: Sanitize the
nameoption by stripping or rejecting CRLF sequences, similar to howenvelope.fromandenvelope.toare already validated on lines 1107-1119 oflib/smtp-connection/index.js. For example:Severity
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Nodemailer: Improper TLS Certificate Validation in OAuth2 Token Fetch Enables Credential Interception
GHSA-r7g4-qg5f-qqm2
More information
Details
Summary
Nodemailer disables TLS certificate verification in its internal HTTPS fetch client through the use of rejectUnauthorized: false inside lib/fetch/index.js.
As a result, OAuth2 token requests trust invalid or self-signed HTTPS certificates and transmit sensitive OAuth credentials over connections that should fail TLS validation.
An attacker in a machine-in-the-middle position can intercept OAuth2 credential exchanges and capture:
The issue was verified through runtime testing using a self-signed HTTPS OAuth endpoint.
Details
Root Cause
The issue originates from the internal HTTPS fetch implementation used by Nodemailer for OAuth2 token retrieval and related outbound HTTPS requests.
Inside:
lib/fetch/index.jsthe request options contain:
rejectUnauthorized: falseThis disables TLS peer certificate verification globally for the internal HTTPS client unless explicitly overridden through optional TLS configuration.
As a result:
This violates expected HTTPS security guarantees.
Vulnerable Flow
The vulnerable execution chain is:
OAuth2 Transport
↓
XOAuth2 token generation
↓
Internal HTTPS fetch client
↓
HTTPS request with rejectUnauthorized:false
↓
Attacker-controlled/self-signed endpoint trusted
↓
OAuth credentials transmitted
PoC
Environment
Mail API (app/server.js)
Malicious HTTPS OAuth Server (poc/evil-oauth.js)
Nodemailer OAuth2 Test (test.js)
Steps to Reproduce
PIC

Impact
The issue effectively downgrades HTTPS security protections for sensitive OAuth credential exchanges.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Nodemailer: CRLF injection in Nodemailer List-* header comments allows arbitrary message header injection
GHSA-268h-hp4c-crq3
More information
Details
Summary
Nodemailer constructs
List-*headers from the caller-providedlistmessage option using internally prepared header values. Thelist.*.commentfield is inserted into those prepared values without removing CR (\r) or LF (\n) characters. Because prepared headers bypass the normal header-value sanitizer and are passed tomimeFuncs.foldLines(), a CRLF sequence in a list comment is emitted as an actual header boundary in the generated RFC822 message.An application that lets a lower-privileged or unauthenticated user influence
list.help.comment,list.unsubscribe.comment,list.subscribe.comment,list.post.comment,list.owner.comment,list.archive.comment, orlist.id.commentcan therefore be made to generate messages containing attacker-chosen additional headers.Details
Source-to-sink evidence:
lib/mailer/mail-message.js:241-249calls_getListHeaders(this.data.list)and adds each returned value withthis.message.addHeader(listHeader.key, value).lib/mailer/mail-message.js:253-296builds each list header value as{ prepared: true, foldLines: true, value: ... }.List-ID,lib/mailer/mail-message.js:272-279copiesvalue.commentinto the generated header value. IfmimeFuncs.isPlainText(comment)returns true, it wraps the comment in quotes rather than encoding or CRLF-normalizing it.List-*headers,lib/mailer/mail-message.js:283-288copiesvalue.commentinto(<comment>). IfmimeFuncs.isPlainText(comment)returns true, the value is not encoded or CRLF-normalized.lib/mime-node/index.js:323-351accepts the prepared header object.lib/mime-node/index.js:533-540trustsoptions.prepared; whenfoldLinesis set, it pushesmimeFuncs.foldLines(key + ': ' + value)directly into the header block.lib/mailer/mail-message.js:299-308removes whitespace and angle brackets fromlist.*.url, so the confirmed injection source is thecommentfield, not the URL field.Default/common exposure evidence:
lib/nodemailer.js:21-60exposes the publiccreateTransport(...).sendMail(...)flow used by the package.examples/full.js:106-123documentslist.unsubscribe.commentandlist.id.commentas normal message options.False-positive screening and negative controls:
subjectheader input containing CRLF was normalized to a singleSubject:header and did not createX-Injectedin the local control case.prepared: truecustom headers are an explicit low-level escape hatch, but this issue is different because Nodemailer itself creates prepared headers from the documentedlist.*.commentoption.Variant analysis:
Local testing confirmed the same root cause for comments in
List-Help,List-Unsubscribe,List-Subscribe,List-Post,List-Owner,List-Archive, andList-ID. These should be fixed together by rejecting or normalizing CR/LF in list comments before prepared header generation, or by avoiding the prepared-header bypass for caller-controlled list values.Affected version evidence and uncertainty:
nodemailer8.0.8 at commit15138a84c543c20aa399218534cdbbfa2ea1ce55._getListHeaderspresent in historical commits including22fcff8(v4.3.0) and related list-header work in9b4f90a(v3.1.8), but older versions were not dynamically tested during this audit.Severity rationale:
Final self-review:
streamTransportPoC and a negativeSubjectcontrol case.PoC
From a clean checkout of
nodemailerat commit15138a84c543c20aa399218534cdbbfa2ea1ce55, run:Observed output in this environment:
Expected vulnerable output:
POSITIVE_HAS_INJECTED=trueand all listed variants ending in=true. Expected negative/control output:CONTROL_HAS_INJECTED=false, showing the ordinarySubjectheader path does not create a separate injected header.Cleanup: none required; the PoC uses only in-memory message generation.
Impact
A lower-privileged attacker who can influence
list.*.commentfields in an application using Nodemailer can inject arbitrary additional headers into generated email messages. This can alter message semantics and downstream mail-client or mail-filter behavior, including adding attacker-controlled metadata headers. The PoC confirms header-boundary injection in the generated RFC822 output; it does not demonstrate SMTP command injection, recipient injection, or code execution.Suggested remediation
Normalize or reject CR and LF in
list.*.commentbefore constructing preparedList-*headers. Prefer sharing the same CRLF-neutralization behavior used for ordinary header values, or avoid usingprepared: truefor caller-controlled list comment content. Add regression tests for CRLF in every documentedlistcomment-bearing field and verify that generated messages do not contain attacker-controlled standalone headers.Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Nodemailer jsonTransport bypasses disableFileAccess and disableUrlAccess during message normalization
GHSA-wqvq-jvpq-h66f
More information
Details
Summary
Nodemailer's
disableFileAccessanddisableUrlAccessoptions are intended to prevent message content and attachments from reading local files or fetching URLs. The normal MIME streaming path enforces those options inMimeNode._getStream(). However,jsonTransportserializes messages by callingmail.normalize(), which resolveshtml,text, alternatives, calendar events, and attachments throughshared.resolveContent()before MIME generation.shared.resolveContent()reads local files and fetches HTTP(S) URLs directly, without receiving or checkingdisableFileAccessordisableUrlAccess.As a result, applications that use
jsonTransportas a safe serializer or queue payload generator while relying ondisableFileAccess/disableUrlAccesscan still be made to read local files into the generated JSON output or make outbound HTTP requests when an attacker controls message content fields such as attachmentpathortext.href.The same missing-enforcement root cause is also reachable before normal streaming when
attachDataUrlscauses_convertDataImages()to callmail.resolveContent(mail.data, 'html', ...); this should be fixed with the same access-control check.Details
Source-to-sink evidence:
lib/nodemailer.js:42-45selectsJSONTransportwhencreateTransport({ jsonTransport: true, ... })is used.lib/mailer/mail-message.js:34-39copies transport-leveldisableFileAccessanddisableUrlAccessoptions intomail.data.lib/json-transport/index.js:52-76serializes mail by callingmail.normalize((err, data) => ...).lib/mailer/mail-message.js:46-135implementsresolveAll()and callsshared.resolveContent(...args, ...)forhtml,text,watchHtml,amp,icalEvent, alternatives, and attachments.lib/shared/index.js:506-562implementsresolveContent().lib/shared/index.js:540-541fetches HTTP(S) content withnmfetch(content.path || content.href).lib/shared/index.js:549-550reads local files withfs.createReadStream(content.path).shared.resolveContent()does not checkdisableFileAccessordisableUrlAccessand does not receive those flags.Control path showing intended enforcement:
lib/mail-composer/index.js:358-359,lib/mail-composer/index.js:367-368, and sibling child-node creation paths passdisableUrlAccessanddisableFileAccessintoMimeNode.lib/mime-node/index.js:51-52stores those flags.lib/mime-node/index.js:984-995rejects file paths withEFILEACCESSwhendisableFileAccessis set.lib/mime-node/index.js:998-1009rejects URLs withEURLACCESSwhendisableUrlAccessis set.test/mail-composer/mail-composer-test.js:1028-1044includes a normal MIME-streaming test that expects file access to be blocked whendisableFileAccess: true.Additional same-root-cause variant:
lib/mailer/index.js:406-434implements_convertDataImages()forattachDataUrls.lib/mailer/index.js:407-410callsmail.resolveContent(mail.data, 'html', ...)whenattachDataUrlsis enabled andmail.data.htmlis present.mail.resolveContent()delegates toshared.resolveContent()atlib/mailer/mail-message.js:42-44, an object-formhtml: { path: ... }orhtml: { href: ... }can be resolved before the later MIME streaming enforcement sees the content.attachDataUrlsto be enabled, so the main reportable default/common path isjsonTransport; both should be fixed by enforcing access flags inside the pre-resolution helper or passing policy into it.Default/common exposure evidence:
jsonTransportis a shipped runtime transport selected by publiccreateTransportoptions.test/json-transport/json-transport-test.js:9-83demonstrates thatjsonTransportintentionally resolves file-backedhtmland attachments into JSON output.disableFileAccessanddisableUrlAccessare documented by code and tests as security controls and are copied from transport options into message data for all transports.False-positive screening and negative controls:
disableFileAccess: trueanddisableUrlAccess: truetransport options for bothjsonTransportand normalstreamTransportcontrols.jsonTransportread the temporary local fixture file and embedded the content in JSON despitedisableFileAccess: true.streamTransportwith the same attachment anddisableFileAccess: truerejected withEFILEACCESS.jsonTransportfetched a local HTTP listener despitedisableUrlAccess: true.streamTransportwith the same URL anddisableUrlAccess: truerejected withEURLACCESS.127.0.0.1and did not contact external infrastructure.Affected version evidence and uncertainty:
nodemailer8.0.8 at commit15138a84c543c20aa399218534cdbbfa2ea1ce55.jsonTransporthas existed since commitd78b63b(2017-02-09, "Added test for json transport"), anddisableFileAccessappears in historical setup commit6218b8d(2017-01-31), but older versions were not dynamically tested during this audit.Severity rationale:
pathorhreftriggers the bypass whenjsonTransportis used.Final self-review:
127.0.0.1HTTP listener.streamTransportrejects the same inputs withEFILEACCESSandEURLACCESS.PoC
From a clean checkout of
nodemailerat commit15138a84c543c20aa399218534cdbbfa2ea1ce55, run:Observed output in this environment:
Expected vulnerable output:
JSON_FILE_BYPASS=true, the printed temporary marker inJSON_FILE_CONTENT, aLOCAL_HTTP_REQUEST=GET /privateline, andJSON_URL_BYPASS=true. Expected negative/control output:STREAM_FILE_CONTROL=EFILEACCESSandSTREAM_URL_CONTROL=EURLACCESS, showing the same policy flags work in the normal streaming transport.Cleanup: the PoC removes its temporary fixture file before exiting and closes the local HTTP server.
Impact
If an application uses
jsonTransportto safely serialize or queue partially user-controlled Nodemailer message objects while relying ondisableFileAccess/disableUrlAccess, an attacker can bypass those protections. The file-read variant can copy local file contents into the generated JSON message output. The URL-fetch variant can force outbound HTTP requests from the application host to local or internal services despite URL access being disabled. The impact depends on what message fields the embedding application exposes and where it stores or returns the generated JSON, but the local PoC confirms both protected sink operations are reached.Suggested remediation
Enforce
disableFileAccessanddisableUrlAccessinsideshared.resolveContent()or pass an explicit policy object into every pre-resolution call and reject protectedpath/hrefvalues before opening files or fetching URLs. Apply the same fix tojsonTransportnormalization and theattachDataUrlspre-plugin path. Add regression tests showingjsonTransportreturnsEFILEACCESS/EURLACCESSfor file and URL content when those flags are set, and thatattachDataUrlscannot resolve object-formhtml.path/html.hrefwhen the corresponding access flag is disabled.Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
nodemailer/nodemailer (nodemailer)
v8.0.9Compare Source
Bug Fixes
v8.0.8Compare Source
Bug Fixes
v8.0.7Compare Source
Bug Fixes
v8.0.6Compare Source
Bug Fixes
v8.0.5Compare Source
Bug Fixes
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
Configuration
📅 Schedule: (UTC)
🚦 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 has been generated by Mend Renovate.