Summary
CVE-2026-59989 is a critical server-side template injection (SSTI) vulnerability in the Volt template compiler of the Phalcon PHP framework (cphalcon). The flaw resides in the join filter, which embeds unescaped template arguments directly into generated PHP code, allowing an attacker who controls template source content to break out of the compiler’s string context and inject arbitrary PHP that executes when the compiled template is rendered. The vulnerability is rated 9.2 (Critical) and is remotely exploitable with no privileges or user interaction required.
Technical details
- Root cause: The Volt compiler’s
joinfilter handler (inCompiler.zep) constructs the compiled PHP call by directly concatenating the separator literal and the piped array argument between single quotes, without escaping either value — e.g. producingjoin('<separator>', <array>)verbatim. - Trigger conditions: An attacker must be able to influence content that is compiled as a Volt template (e.g., user-controlled input reflected into a template string, user-supplied templates, or template fragments stored and later rendered). By crafting a separator or array argument that breaks out of the emitted single quotes, the attacker can inject arbitrary PHP statements into the compiled cache file.
- Attack vector: Network — exploitation requires no authentication or user interaction beyond the application compiling and rendering attacker-influenced template content.
- Impact: Full remote code execution in the context of the web server/PHP process once the malicious compiled template is executed, potentially leading to complete compromise of confidentiality, integrity, and availability of the affected application and host.
Affected software
- Phalcon (cphalcon) versions ≤ 5.15.0 (all versions prior to 5.16.0)
- Fixed in Phalcon 5.16.0
Severity
- CVSS Score: 9.2 (Critical)
- CVSS v4.0 Vector:
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CWE-94: Improper Control of Generation of Code (‘Code Injection’)
- CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
Mitigation and recommended actions
- Immediate: Upgrade Phalcon (cphalcon) to version 5.16.0 or later, which fixes the unescaped
joinfilter argument handling in the Volt compiler. - If immediate patching is not possible:
- Audit applications for any Volt templates that incorporate user-controlled input into
joinfilter arguments (separator or array values) and remove or strictly sanitize such input. - Avoid compiling or rendering templates built from untrusted or user-supplied content.
- Clear and regenerate any existing Volt compiled template cache files after patching, since previously compiled malicious templates could persist as cached PHP code.
- Restrict file system write access to template cache directories to reduce the impact of any residual injected code.
- Audit applications for any Volt templates that incorporate user-controlled input into

