SA-CONTRIB-2026-341: Critical severity composer/drupal/mail_safety vulnerability
This module enables you to test and debug outgoing emails, as well as prevent emails from being sent. In certain cases, the module doesn't securely pass data to PHP's unserialize() function, which could result in remote code execution (RCE) via PHP object injection. This vulnerability is mitigated by the fact that in order for it to be exploitable, a separate vulnerability must be present to allow an attacker to store malicious data.
Credit
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/drupal/mail_safetyto a version that resolves this vulnerability.Fixed in 2.2.1Fixed in 2.1.1
Event History
Frequently Asked Questions
What additional condition is required for exploitation?
An attacker must be able to use a separate vulnerability to store malicious data. The unsafe handling of that stored data can then lead to PHP object injection and remote code execution.
Who is most exposed to this issue?
Deployments using composer/drupal/mail_safety are exposed when another vulnerability allows an attacker to persist malicious data that reaches the affected unserialize() handling.