CVE-2026-142395: Mail Safety - Critical - PHP object injection - SA-CONTRIB-2026-341
Deserialization of Untrusted Data vulnerability in Drupal Mail Safety allows Object Injection. This issue affects Mail Safety versions: from 0.0.0 to 2.1.1, from 2.2.0 to 2.2.1.
Other sources
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.
— OSV
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.1.1 - Upgrade
Upgrade
composer/drupal/mail_safetyto a version that resolves this vulnerability.Fixed in 2.2.1
Event History
Frequently Asked Questions
What additional condition is required for exploitation?
An attacker must be able to store malicious data through a separate vulnerability. The unsafe deserialization issue alone is not sufficient to achieve remote code execution.
Who is most exposed to this issue?
Installations using composer/drupal/mail_safety are affected by the vulnerable behavior described. Practical exposure depends on whether another flaw allows an attacker to persist attacker-controlled serialized data.
How can I determine whether exploitation is plausible in my environment?
Review the application and related components for vulnerabilities or functionality that permit an attacker to store arbitrary or attacker-controlled data. If no such storage path is available to an attacker, the stated exploitation prerequisite is not met.