Mail Safety
3 security fixes in one update. Mail Safety fixed 3 separate security bugs at once: 2 cross site scripting, 1 php object injection. One update covers all of them. The most serious, SA-CONTRIB-2026-342, is explained here and the full list is at the end of the card.
The module does not properly clean up the content of emails in certain situations. A person could use this to run harmful scripts which could let them view or change some information on the site.
- Who could do thisAnyone visiting the site. No login needed.
- Does it apply to youA site is affected if the option to send mail to the dashboard is turned on.
- Has it been used in attacksNo sign of it.
- How urgentDrupal rates this critical. Cyber Essentials expects a fix within 14 days. Do it this week.
Tell your developerUpdate Mail Safety to 2.1.1 or 2.2.1, whichever branch you are on.
For developers: what the fix changed
The fix sanitises the email body using Xss::filterAdmin in MailSafetyController and removes the raw filter from the details output in the mail safety details template. It also restricts allowed classes during unserialisation in MailSafetyController and DashboardForm.
src/Controller/MailSafetyController.php+5 −2 fixsrc/Form/DashboardForm.php+1 −1 fixtemplates/mail-safety-details.html.twig+1 −1 fix
- Critical · Cross site scripting · SA-CONTRIB-2026-342
- Critical · Cross site scripting · SA-CONTRIB-2026-344
- Critical · PHP object injection · SA-CONTRIB-2026-341