Bumped @tryghost/nodemailer in ghost/core#27686
Conversation
- ghost/core was on 0.3.48, two majors behind the latest published version.
2.2.0 declares nodemailer 8.0.5 directly, replacing the transitively-pulled
6.10.1 that had four advisories against it
- Public API of @tryghost/nodemailer is unchanged: same module.exports
function (transport, options) signature, same set of supported transport
names (smtp, mailgun, sendmail, ses, direct, stub)
- Two internal behavior changes:
* `direct` now uses nodemailer's built-in {direct: true} option instead of
the abandoned nodemailer-direct-transport wrapper. Functionally
equivalent — direct mode is still active — but the transporter's name
metadata is now 'SMTP' instead of 'SMTP (direct)'. Test assertions
updated to match and to also verify options.direct === true so the
direct-mode coverage is preserved
* `ses` migrates from @aws-sdk/client-ses (v1: SES + SendRawEmail-by-API)
to @aws-sdk/client-sesv2 (v2: SESv2Client + SendRawEmailCommand). AWS
SES users may need to verify their IAM permissions cover the v2 API
surface; this transition was an upstream choice in @tryghost/nodemailer
2.2.0 itself
- Closes 4 advisories (1 high, 2 mod, 1 low) all rooted in nodemailer 6.10.1
- Verified: pnpm test passes 6283/6283 ghost/core (the comments-ui editor
markdown flake reproduces on clean main and is unrelated); single
nodemailer version (8.0.5) and single @tryghost/nodemailer version (2.2.0)
in the resolved tree
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
WalkthroughThe 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27686 +/- ##
==========================================
- Coverage 73.19% 73.19% -0.01%
==========================================
Files 1561 1561
Lines 127073 127073
Branches 15396 15393 -3
==========================================
- Hits 93014 93009 -5
+ Misses 33101 33087 -14
- Partials 958 977 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Why
ghost/corewas pinning@tryghost/nodemailer@0.3.48, two majors behind the latest published2.2.0. The 0.3.48 wrapper declaresnodemailer: ^6.6.3and was pulling a transitivenodemailer@6.10.1alongsideghost/core's directnodemailer: 8.0.5— meaning the email-sending wrapper itself was running on a vulnerable nodemailer version regardless of whatghost/coredeclared directly.@tryghost/nodemailer@2.2.0is the current Ghost-team-released version of this package and usesnodemailer@8.0.5directly. Bumping the wrapper is the right supply-chain answer here — a transitive override onnodemailerwould force the same end-state but on top of wrapper code its maintainers never tested with nodemailer 8.Behavior changes
The wrapper's public API is unchanged (same
module.exports = function (transport, options)signature, same supported transport names:smtp,mailgun,sendmail,ses,direct,stub). Two internal mechanics differ:directtransport now uses nodemailer's built-in{direct: true}option instead of the abandonednodemailer-direct-transportwrapper. Direct mode is still active and functionally equivalent. The only observable difference is the transporter'snamemetadata:'SMTP'(built-in) instead of'SMTP (direct)'(old wrapper). Fourghost-mailer.test.jsassertions updated to match the new name and to additionally verifyoptions.direct === true— the direct-mode test coverage is preserved (and arguably more explicit than the old name-string proxy).sestransport migrates from@aws-sdk/client-ses(legacy v1:new aws.SES()+SendRawEmailover the v1 API) to@aws-sdk/client-sesv2(SESv2Client+SendRawEmailCommand). This was an upstream choice in@tryghost/nodemailer@2.2.0itself. AWS-on-SES users may need to verify their IAM permissions cover the SESv2 endpoints (ses:SendEmailon SESv2 resources rather than the v1 SES resources).The other transports (
smtp,mailgun,sendmail,stub) are unchanged.Test plan
pnpm install— single resolved version of both@tryghost/nodemailer(2.2.0) andnodemailer(8.0.5) in the treepnpm test— 6283/6283 ghost/core unit tests pass after updating the four direct-transport name assertions inghost-mailer.test.js(the pre-existing comments-ui editor markdown flake reproduces on clean main and is unrelated)