CakePHP email header injection in mail transports
cakephp
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| cakephp/cakephp Packagist |
|
|
cakephp
| Product | Affected | Fixed in |
|---|---|---|
| cakephp/cakephp Packagist |
|
|
5.2.145.3.7CakePHP 4.5.12, 4.6.5, 5.1.8 through 5.1.10, 5.2.14 through 5.2.15, 5.3.7, and 5.4.0 through 5.4.3 contain an email header injection vulnerability because SmtpTransport and MailTransport strip only CRLF pairs from header values, an incomplete fix for CVE-2026-77634. Attackers controlling custom headers set via Message::setHeaders() or Message::addHeaders() can insert a bare CR or LF to inject headers like Bcc, redirecting or altering outgoing mail.
From the CVE record · VulnCheck
CakePHP’s SmtpTransport and MailTransport strip CRLF pairs but not bare CR or LF characters from email header values. An attacker who can control custom headers passed to Message::setHeaders() or Message::addHeaders() can inject headers such as Bcc, redirecting or altering outgoing mail. The input does not specify authentication or user-interaction requirements.
Teams using the Packagist cakephp/cakephp package should check the listed affected ranges, starting at 4.5.0, 4.6.0, 5.0.0, 5.2.0, and 5.3.0, and verify their installed version against the vendor advisory because the supplied description also calls some listed fixed versions vulnerable.