Summary
CVE-2026-77634 is a CRLF (carriage return / line feed) injection vulnerability in CakePHP’s mail handling. Custom mail headers added through Message::setHeaders() or Message::addHeaders() are not sanitized for CRLF byte sequences, allowing an attacker to inject arbitrary email headers when user-controlled data is passed into those methods. The issue carries a CVSS score of 8.2 (High) and is remotely exploitable over the network.
Technical details
- Root cause: CakePHP’s
Messageclass (used bySmtpTransportand other mail transports) does not strip or reject CRLF byte sequences when custom headers are set viasetHeaders()oraddHeaders(). - Trigger condition: An application must pass user-controlled input directly into these header-setting methods without its own sanitization.
- Attack vector: Network — no authentication or user interaction beyond application-level input is required to submit the malicious data (e.g., via a web form that populates email headers).
- Impact: Header injection can be used to manipulate outgoing email headers (e.g., adding recipients, altering
Subject/From, or injecting additional headers), affecting the integrity of generated messages. - Weakness classification: CWE-93 (Improper Neutralization of CRLF Sequences).
Affected software
- CakePHP 4.5.0 through 4.5.11
- CakePHP 4.6.0 through 4.6.4
- CakePHP 5.0.0 through 5.1.8
- CakePHP 5.2.0 through 5.2.13
- CakePHP 5.3.0 through 5.3.6
Severity
- CVSS Score: 8.2 (High)
- Vector:
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N(published as CVSS v4.0; no CVSS v3.1 vector has been published for this CVE)
Mitigation and recommended actions
- Immediate: Upgrade to the patched CakePHP release for your branch:
- 4.5.x → 4.5.12
- 4.6.x → 4.6.5
- 5.1.x → 5.1.9
- 5.2.x → 5.2.14
- 5.3.x → 5.3.7
- If patching is not immediately possible: Strip CRLF byte sequences from any header values before passing them to
Message::setHeaders()oraddHeaders(), and avoid passing raw user-controlled input into mail header–setting methods.

