Aug 22, 2026·5 min read·2 visits
Phalcon Volt template engine directly concatenates raw AST tokens in the 'join' filter, allowing remote code execution if template contents are user-controlled.
A critical server-side template injection (SSTI) vulnerability exists in the Volt template engine of the Phalcon PHP framework. In versions 5.15.0 and earlier, raw AST token values for filter arguments in the 'join' filter are directly spliced into the generated PHP template code. This allows an attacker who can influence Volt templates to execute arbitrary PHP code during template rendering.
The Phalcon framework is a high-performance PHP framework delivered as a C extension. Its native templating engine, Volt, compiles twig-like syntax into raw PHP files that are subsequently cached and executed on the web server. This design yields high performance but demands strict isolation and validation during the compilation phase to prevent injection of malicious PHP statements.\n\nUnder normal operations, the Volt compiler parses structural components and routes variables or literals through a unified expression evaluation system. This security layer ensures that strings are correctly escaped and variable boundaries are preserved in the generated PHP source. The vulnerability in the compiler's handling of specific filter expressions represents a breakdown of this containment layer.\n\nThis specific security flaw is categorized as a server-side template injection (SSTI) vulnerability, tracked under CWE-94 (Improper Control of Generation of Code) and CWE-1336 (Improper Neutralization of Special Elements in a Template Engine). The flaw allows an attacker to bypass language safety boundaries when template contents or filter parameters can be manipulated.
The vulnerability is situated within the filter resolving logic of the Volt compiler class, located in phalcon/Mvc/View/Engine/Volt/Compiler.zep. During the translation of Volt templates to PHP code, the resolveFilter method processes individual filters applied to variables. When the compiler processes the join filter, it maps the template operation to the native PHP join() function.\n\nIn versions 5.15.0 and earlier, the compiler extracts the raw token representation of the separator and operand arguments without routing them through the standard expression compilation pipeline. Instead of processing the AST nodes recursively via the safe expression evaluator, the engine extracts the raw string value of the arguments directly using funcArguments[1]['expr']['value'] and concatenates them within single-quoted string boundaries.\n\nThis direct concatenation pattern assumes that the input token values are safe string literals. Because the compiler does not validate or escape single quotes present within these raw tokens, any single quote in the input string terminates the compiled string literal context prematurely. This enables raw PHP statement injection into the resulting cached template file.
The following code diff displays the exact block modified in phalcon/Mvc/View/Engine/Volt/Compiler.zep to resolve the vulnerability. Note how the insecure concatenation is replaced with structured expression resolution.\n\ndiff\n@@ -2542,8 +2542,8 @@ class Compiler implements InjectionAwareInterface\n case \"format\":\n return \"sprintf(\" . arguments . \")\";\n case \"join\":\n- return \"join('\" . funcArguments[1][\"expr\"][\"value\"]\n- . \"', \" . funcArguments[0][\"expr\"][\"value\"] . \")\";\n+ return \"join(\" . this->expression(funcArguments[1][\"expr\"])\n+ . \", \" . this->expression(funcArguments[0][\"expr\"]) . \")\";\n case \"json_encode\":\n return \"json_encode(\" . arguments . \")\";\n\n\nIn the vulnerable implementation, the compiler evaluates funcArguments[1]['expr']['value'] and outputs it directly. This bypasses this->expression(), which is responsible for safely serializing types and escaping literals. In the patched implementation, both arguments are handled by this->expression(), generating valid, isolated, and properly escaped PHP expressions regardless of character payload contents.\n\nmermaid\ngraph LR\n A[\"Volt Template Input\"] --> B[\"Lexer & Parser AST\"]\n B --> C[\"Compiler: resolveFilter('join')\"]\n C --> D[\"Vulnerable: Direct String Splicing\"]\n C --> E[\"Patched: this->expression() Validation\"]\n D --> F[\"Insecure Cache File with PHP Payloads\"]\n E --> G[\"Secure PHP Cache with Escaped Literals\"]\n
Exploitation of this vulnerability requires that an attacker can control the template source code or manipulate parameters that are compiled inline. This environment is common in multi-tenant content management systems, blogging platforms, or dashboard systems that permit users to customize layouts or filter styles dynamically using template configurations.\n\nWhen a user-controlled parameter is passed directly as the separator argument inside a template (e.g., {{ items | join(user_input) }}), the compiler processes the argument. An attacker can set the value of the separator parameter to a payload designed to escape the single-quote enclosure. A typical payload contains a closing single quote, a closing parenthesis, a semicolon to terminate the native instruction, the arbitrary payload commands, and a PHP comment initiator.\n\nUpon processing, the compiler places this payload directly into the target PHP template cache on disk. When the page is subsequently loaded or rendered via Phalcon\\Mvc\\View\\Engine\\Volt::render(), the server executes the generated PHP file. The injected payload executes within the security context of the parent web server process, leading to command execution or local file manipulation.
The security impact of CVE-2026-59989 is classified as critical. Successful exploitation results in arbitrary PHP code execution on the hosting infrastructure, which compromises confidentiality, integrity, and availability of the web application and underlying resources.\n\nThe vulnerability does not require authentication to trigger if the target application exposes custom template rendering features to unauthenticated users. Since the resulting injected code is cached on disk, the execution is persistent until the cache is cleared or overwritten. Attackers can leverage this position to read environment variables, access databases, or deploy persistent backdoors.\n\nThe CVSS v4.0 score is rated at 9.2 (Critical) with the 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. Although the vulnerability requires specific configuration conditions (dynamic template compilation under user influence), the severity of post-exploitation outcomes warrants immediate remediation.
Remediation requires upgrading Phalcon to version 5.16.0 or higher. This update replaces the direct AST interpolation with the safer compiler pipelines. Organizations should verify their current Phalcon extension version via the command line or phpinfo() outputs.\n\nIf upgrading is not immediately possible, code audits must be performed to ensure no template strings are dynamically generated using unsanitized user inputs. Developers must avoid patterns where variables are interpolated into Volt source strings before compile time. The template code must remain static, and variable data should be passed solely via standard context parameters.\n\nAdditionally, file system permissions on compiled template directories should be restricted. Although the web server process requires write access to create the PHP cache files, segregating these directories and monitoring them for unexpected changes or the inclusion of suspicious PHP functions (such as system, exec, or eval) can serve as an effective detective control.
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| Product | Affected Versions | Fixed Version |
|---|---|---|
cphalcon Phalcon | <= 5.15.0 | 5.16.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-94, CWE-1336 |
| Attack Vector | Network (AV:N) |
| CVSS v4.0 Score | 9.2 (Critical) |
| Exploit Status | PoC (Proof of Concept) |
| KEV Status | Not Listed |
| Affected Component | Volt Template Compiler (join filter) |
The application handles templates in a way that allows an attacker to inject source code which is later executed on the server.
CVE-2026-76905 is a high-severity Denial of Service (DoS) vulnerability in the getkin/kin-openapi library, specifically inside the openapi3filter sub-package. When processing multipart/form-data request validation errors, a missing nil-pointer guard causes a Go runtime panic during error formatting. This panic terminates the active server process if no recovery handler is present, resulting in a total denial of service. The vulnerability affects versions from v0.10.0 to v0.140.0, and is resolved in v0.141.0.
CVE-2026-61539 is a critical remote code execution vulnerability in Xinference, an inference API framework for open-source LLMs. In version 2.5.0 and earlier, model-generated outputs representing Llama3 tool calls are passed directly to Python's built-in eval() function inside the parser components. By manipulating conversational input or injecting instructions, an attacker can influence the LLM to output a Python expression containing malicious system commands, resulting in unauthenticated remote code execution on the host. This vulnerability has been resolved in Xinference version 2.7.0.
An uncontrolled resource consumption vulnerability (CWE-400/CWE-789) exists within the kin-openapi Go library prior to version 0.142.0. The vulnerability occurs during the processing of highly sparse array indexes inside query parameters defined in deepObject style. An unauthenticated remote attacker can exploit this flaw to cause an immediate Out-of-Memory (OOM) crash of the target application.
A critical prototype pollution and sandbox escape vulnerability was discovered in the JSONata query and transformation library before versions 1.8.8 and 2.2.0. By providing a malicious JSONata expression that bypasses ownership checks on object properties, remote attackers can execute arbitrary code in the context of the host Node.js application.
CVE-2026-63135 is a critical stored Cross-Site Scripting (XSS) vulnerability affecting YOURLS (Your Own URL Shortener) versions 1.5.1 up to (but not including) 1.10.4. Unauthenticated remote attackers can inject malicious JavaScript arrays by crafting an HTTP Referer header sent to a short URL redirect. This value is saved in the database logs and executed without context-aware escaping when an administrative user views the corresponding statistics visualization page.
CVE-2026-68508 is a high-severity arbitrary code execution vulnerability in facebookresearch/hydra (hydra-core) prior to version 1.3.4. The vulnerability exists within the dynamic instantiation system hydra.utils.instantiate(), which resolves and executes arbitrary Python callables from configuration files. An attacker capable of submitting untrusted configurations can achieve arbitrary code execution in the context of the consuming process.