Executive brief
CakePHP DebugKit is a development debugging utility included in CakePHP applications. The MailPreview component uses reflection unsafely, allowing attackers to execute arbitrary code if the application runs in debug mode with certain hostname conditions. In production environments, this should have no impact as debug mode should be disabled, but misconfigured development deployments could be compromised.
Technical details
The vulnerability exists in the MailPreview component of CakePHP DebugKit and is classified as unsafe reflection (CWE-470). The root cause is the use of externally-controlled input to select which classes or code to instantiate via PHP reflection, without sufficient validation. Attack vector is network-based; exploitation requires: (1) debug mode enabled, and (2) hostname matching a 'local' domain or being in a whitelist. Privileges required are low (low privilege access sufficient). An attacker can achieve arbitrary constructor execution, resulting in potential code execution. Patches are available in versions 4.10.3 and 5.2.4.
Affected products
- CakePHP DebugKit < 4.10.3, >= 5.0.0 and < 5.2.4
Timeline
- 2026-06-16: disclosed: Published to GitHub Advisory Database
- 2026-06-16: patched: Patches released in versions 4.10.3 and 5.2.4
- 2026-08-26: advisory: Updated in GitHub Advisory Database