Fix: Upgrade Nodemailer to address SMTP command injection vulnerability (#19151)

📄 Summary

This PR upgrades the nodemailer dependency to a secure version (≥ 8.0.4)
to fix a known SMTP command injection vulnerability
(GHSA-c7w3-x93f-qmm8).

🚨 Issue

The current version used in twenty-server (^7.0.11, resolved to 7.0.11 /
7.0.13) is vulnerable to SMTP command injection due to improper
sanitization of the envelope.size parameter.
This could allow CRLF injection, potentially enabling attackers to add
unauthorized recipients to outgoing emails.

🔍 Root Cause

The vulnerability originates from insufficient validation of
user-controlled input in the SMTP envelope, specifically the size field,
which can be exploited via crafted input containing CRLF sequences.

 Changes
Upgraded nodemailer to version ^8.0.4
Ensured compatibility with existing email sending logic
Verified that no breaking changes affect current usage

🔐 Security Impact

This update mitigates the risk of:

SMTP command injection
Unauthorized email recipient manipulation
Potential data leakage via crafted email payloads
📎 References
GHSA: GHSA-c7w3-x93f-qmm8
CVE: (see linked report in issue)

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
Gabriel
2026-03-31 21:55:50 +02:00
committed by GitHub
parent ac8e0d4217
commit 36dece43c7
5 changed files with 13 additions and 19 deletions
@@ -37,7 +37,7 @@
"lodash.pickby": "^4.6.0",
"lodash.snakecase": "^4.1.1",
"lodash.upperfirst": "^4.3.1",
"nodemailer": "^7.0.11",
"nodemailer": "^8.0.4",
"sharp": "^0.34.5",
"uuid": "^10.0.0",
"winston": "^3.14.2"
@@ -2195,10 +2195,10 @@ __metadata:
languageName: node
linkType: hard
"nodemailer@npm:^7.0.11":
version: 7.0.11
resolution: "nodemailer@npm:7.0.11"
checksum: 10c0/208f108fdb4c5dd0e3a2f013578d53dad505cf1b9c7a084f6d22fc9d6f3912daafb4a23793ca568ff848afc35f15f4eb24382d3f6f9fb8ede4a8410d4ca63618
"nodemailer@npm:^8.0.4":
version: 8.0.4
resolution: "nodemailer@npm:8.0.4"
checksum: 10c0/5fb6fa72645b541c18b84b861de46f4740449e1d7c987b4d9ef715d815d613f93262225bc319e217df6215d6f123efadb9a412dcf937fe0a41cbecf279dfb2a0
languageName: node
linkType: hard
@@ -2510,7 +2510,7 @@ __metadata:
lodash.pickby: "npm:^4.6.0"
lodash.snakecase: "npm:^4.1.1"
lodash.upperfirst: "npm:^4.3.1"
nodemailer: "npm:^7.0.11"
nodemailer: "npm:^8.0.4"
sharp: "npm:^0.34.5"
uuid: "npm:^10.0.0"
winston: "npm:^3.14.2"