Skip to content

fix(deps): update dependency nodemailer to v10.0.9 [security] - #3967

Merged
yannickmonney merged 1 commit into
mainfrom
renovate/npm-nodemailer-vulnerability
Sep 30, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
renovate/npm-nodemailer-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
nodemailer (source) 10.0.2 → 10.0.9 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Nodemailer: Quadratic backtracking in the addressparser free-text fallback allows remote denial of service

CVE-2026-100700 / GHSA-v53p-9fqp-m79j

More information

Details

Summary

When addressparser finds no address by its strict reading, it falls back to pulling one out of the free text with /\s*\b[^@\s]+@[^\s]+\b\s*/. That pattern backtracks quadratically: [^@\s]+ is retried from every offset and rescans the run to the next @ each time. A single header value holding a long whitespace-free run with no usable @ blocks the Node.js event loop for tens of seconds.

It is cheaper to exploit than GHSA-prgh-xp8r-p3m5: 273KB is enough for ~43s, where the comment-joined shape needed ~1.5MB for ~10s.

Details

The fallback in src/addressparser/index.ts ran the pattern as a search. [^@\s]+ crosses neither whitespace nor @, so from each start offset it scans forward to the next @ or to the end of the run and then fails, and the engine simply advances one character and repeats. Three shapes make every offset fail:

  • the run holds no @ at all
  • the only @ has nothing after it
  • the only @ has nothing before it

A fourth reaches it with a valid address present but placed past a long run, so the long run is walked before the match is found.

PoC
const addressparser = require('nodemailer/lib/addressparser');
const s = Date.now();
addressparser(' >' + '>[x][x]'.repeat(40000)); // 273KB
console.log(Date.now() - s, 'ms'); // ~43000 ms, blocking

Measured on 10.0.5:

Value Parse time
'[x]'.repeat(40000) (117KB) 9.0 s
'[x]'.repeat(40000) + '@' (117KB) 8.9 s
'@' + '[x]'.repeat(40000) (117KB) 8.8 s
' >' + '>[x][x]'.repeat(40000) (273KB) 42.9 s
Impact

Algorithmic-complexity denial of service. Node is single threaded, so the block stalls the whole process. Reachable without authentication anywhere inbound header values are handed to this parser, mailparser being the notable case, and reachable from application input wherever a user-supplied string is used as a message address, since mime-node parses to, from and cc when composing.

Patch

The search is replaced by a single linear pass that finds the one offset the pattern can match at, which is then applied there with a sticky regex. Match results are unchanged, verified against the previous implementation over 3.4 million random strings comparing both the match offset and the matched text, plus 800k full-parse comparisons.

Found while validating the report in GHSA-prgh-xp8r-p3m5, not reported externally.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Nodemailer: Quoted local-part can produce malformed envelope recipient through RFC 5322 comment parsing

CVE-2026-100699 / GHSA-g57g-f23g-4646

More information

Details

Summary

Nodemailer's address parser can produce an unexpected recipient address when an RFC 5322 comment follows the domain of an address whose local-part is a quoted string.

For example:

"user"@example.com(x)evil.com

is parsed as:

{
  address: "[email protected] evil.com",
  name: ""
}

The resulting address therefore contains additional attacker-controlled domain text separated by a literal space.

The parsed .address value is subsequently propagated into the SMTP envelope:

src/addressparser/index.ts
        ↓
recipient.address
        ↓
src/mime-node/index.ts
        ↓
envelope.to

The envelope construction uses the parsed address without another strict address validation step.

This appears to be a variant of the RFC 5322 comment parsing issue addressed by GHSA-cc9r-2j5m-2m83, but it follows a different parser path when the local-part is quoted.

Reproduction

Input:

"user"@example.com(x)evil.com

Observed parser output:

address: "[email protected] evil.com"
name: ""

A second example:

"a"@b.com(c)d.com(e)f.com

produces:

address: "[email protected] d.com f.com"
name: ""

For comparison, the corresponding unquoted form:

[email protected](x)evil.com

takes a different code path and is handled by the existing protection differently.

Technical Details

The issue is caused by different parsing behavior for quoted and unquoted local-parts.

The quoted-local-part variant allows the comment-separated trailing domain atoms to remain in the resulting .address value.

That value is then used when constructing the message envelope:

envelope.to = recipients.map(to => to.address as string)

No additional strict recipient validation is performed at this boundary.

Security Impact

The confirmed impact is that attacker-controlled comment content can result in a malformed/ambiguous recipient address being accepted by the parser and propagated into envelope.to.

The reporter did not confirm successful delivery to an unintended recipient through a real SMTP server using this exact quoted-local-part variant.

The remaining question is how real SMTP servers and other Nodemailer transports handle an envelope recipient containing a value such as:

An end-to-end SMTP test is required to determine whether this parser behavior results in an exploitable delivery or recipient-validation bypass.

Relationship to GHSA-cc9r-2j5m-2m83

This report is intended as a potential variant/follow-up to GHSA-cc9r-2j5m-2m83.

The existing advisory addresses RFC 5322 comment handling in email domains. This report identifies a separate parser path involving quoted local-parts that can preserve additional domain-like content in the normalized address.

Please evaluate whether this behavior is already covered by the existing fix or represents a remaining parser variant.

Suggested Fix

The parser should consistently reject or correctly terminate addresses containing trailing domain atoms after RFC 5322 comments, regardless of whether the local-part is quoted.

In particular:

"user"@example.com(x)evil.com

should not result in:

The envelope-generation layer should also avoid assuming that a parser-produced address is safe for SMTP delivery without appropriate validation.

Verification Status

Confirmed:

  • Parser accepts the quoted-local-part variant.
  • Parser produces an address containing additional attacker-controlled text.
  • The resulting address is propagated into envelope.to.

Not confirmed by reporter:

  • Successful delivery through a real SMTP server.
  • Delivery to an unintended recipient.
  • Exploitability against a specific downstream SMTP implementation.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

nodemailer/nodemailer (nodemailer)

v10.0.9

Compare Source

Bug Fixes
  • addressparser: bound the '@​' probe to the run being scanned (1465c3f)
  • addressparser: keep the text after a comment out of a quoted local part address (2f36eb1)

v10.0.8

Compare Source

Bug Fixes
  • mime-node: clean the boundary where it is written, not only where it is built (e14278d)
  • mime-node: drop every control character from multipart boundary material (a82a355)

v10.0.7

Compare Source

Bug Fixes
  • mime-funcs: do not double encode Buffer input when chunking base64 mime words (#​1865) (4327a59)
  • mime-node: keep a boundary that is only line breaks from stripping to empty (ec46800)
  • mime-node: strip line breaks from multipart boundary material (#​1867) (03c1a5c)
  • smtp-pool: release rate-limited connections on close (#​1866) (7f5c7a4)

v10.0.6

Compare Source

Bug Fixes
  • addressparser: scan free text for an address in linear time (437d7fc)

v10.0.5

Compare Source

Bug Fixes
  • addressparser: parse comment-joined addresses in linear time (c07f175)

v10.0.4

Compare Source

Bug Fixes
  • fetch: scope a cookie without a Path to the RFC 6265 default path (2f907cb)
  • fetch: send cookies set with Path back to the exact path (#​1861) (d557113)
  • mail-composer: keep httpHeaders and tls for href alternatives and icalEvent (#​1862) (7f502be)
  • resolve well-known services by their primary domains (#​1859) (085f525)
  • ses-transport: throw a configuration error when the SES client is missing (#​1863) (4d9c4c9)

v10.0.3

Compare Source

Bug Fixes
  • fetch: honor the cookie Domain attribute without accepting public suffixes (1608391), closes #​1856

Configuration

📅 Schedule: (in timezone Europe/Zurich)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@yannickmonney
yannickmonney merged commit 895b529 into main Sep 30, 2026
59 checks passed
@yannickmonney
yannickmonney deleted the renovate/npm-nodemailer-vulnerability branch September 30, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant