fix(deps): update dependency nodemailer to v8 [security]#933
fix(deps): update dependency nodemailer to v8 [security]#933ham-renovate wants to merge 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughUpdated the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@platforms/blabsy/client/functions/package.json`:
- Line 19: Update the mismatched types by changing the dev dependency
"@types/nodemailer" to a v8.x-compatible version to match "nodemailer": "^8.0.0"
in package.json (update the "@types/nodemailer" entry to "^8.0.0");
alternatively, as a temporary workaround edit tsconfig.json to set
"skipLibCheck": true to avoid the type conflict until the official v8 type
definitions land. Ensure you update the package.json dependency key
"@types/nodemailer" and run install to verify types resolve correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4e69c808-7634-4fe4-a9b9-4c69a4b84af9
⛔ Files ignored due to path filters (1)
platforms/blabsy/client/functions/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (1)
platforms/blabsy/client/functions/package.json
| "firebase-admin": "^10.2.0", | ||
| "firebase-functions": "^4.0.1", | ||
| "nodemailer": "^7.0.0" | ||
| "nodemailer": "^8.0.0" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Search for nodemailer usage patterns that may be affected by v8 breaking changes
echo "=== Checking createTransport usage ==="
rg -n -C3 'createTransport' --type=ts --glob='!node_modules/**'
echo -e "\n=== Checking for pool transport usage ==="
rg -n -C3 'pool.*:.*true' --type=ts --glob='!node_modules/**'
echo -e "\n=== Checking for direct transport usage ==="
rg -n -C3 'direct.*:.*true' --type=ts --glob='!node_modules/**'
echo -e "\n=== Checking for custom envelope properties ==="
rg -n -C3 'envelope\s*:' --type=ts --glob='!node_modules/**'
echo -e "\n=== Checking for stream transport usage ==="
rg -n -C3 'streamTransport' --type=ts --glob='!node_modules/**'
echo -e "\n=== Checking for XOAuth2 usage ==="
rg -n -C3 'xoauth2' --type=ts --glob='!node_modules/**'Repository: MetaState-Prototype-Project/prototype
Length of output: 7943
🌐 Web query:
What are the breaking changes in nodemailer v8 and is @types/nodemailer v6.4.6 compatible with nodemailer v8.0.0?
💡 Result:
The breaking changes in Nodemailer v8.0.0 are minimal: the error code 'NoAuth' has been renamed to 'ENOAUTH'. This is the only explicitly marked breaking change in the official changelog and release notes. Other changes in v8 are primarily bug fixes, such as improved socket cleanup, DNS fallback hardening, centralized error codes, and connection fallbacks. @types/nodemailer v6.4.6 is not compatible with Nodemailer v8.0.0. The v6.x types predate Nodemailer v8 (with v6.4.x last updated around 2024), and a pull request to update the types specifically for v8.0.0 remains open as of March 3, 2026 (PR #74624 in DefinitelyTyped). While newer type versions like v7.x exist for Nodemailer v7, they do not cover v8 changes. Users should use @types/nodemailer@latest (currently ~6.4.x or v7.x branches) with potential type mismatches or wait for the v8 types PR to merge, or use skipLibCheck: true in tsconfig.json as a temporary workaround.
Citations:
- 1: https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md
- 2: https://github.com/nodemailer/nodemailer/releases
- 3: https://newreleases.io/project/github/nodemailer/nodemailer/release/v8.0.0
- 4: [nodemailer] Update type definitions to v8 DefinitelyTyped/DefinitelyTyped#74624
Update @types/nodemailer to v8.x for type compatibility.
The nodemailer v8.0.0 upgrade correctly addresses a critical SMTP command injection vulnerability. The only breaking change in v8 is a renaming of the error code 'NoAuth' to 'ENOAUTH', which doesn't affect the codebase since it only uses basic createTransport() with Gmail service.
However, @types/nodemailer v6.4.6 is incompatible with nodemailer v8.0.0. Update line 22 to "@types/nodemailer": "^8.0.0" or use skipLibCheck: true in tsconfig.json as a temporary workaround while the type definitions PR merges.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@platforms/blabsy/client/functions/package.json` at line 19, Update the
mismatched types by changing the dev dependency "@types/nodemailer" to a
v8.x-compatible version to match "nodemailer": "^8.0.0" in package.json (update
the "@types/nodemailer" entry to "^8.0.0"); alternatively, as a temporary
workaround edit tsconfig.json to set "skipLibCheck": true to avoid the type
conflict until the official v8 type definitions land. Ensure you update the
package.json dependency key "@types/nodemailer" and run install to verify types
resolve correctly.
This PR contains the following updates:
^7.0.0→^8.0.0GitHub Vulnerability Alerts
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
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 becomes conflicted, 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 Renovate Bot.