CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-59989

CVE-2026-59989: Remote Code Execution via Server-Side Template Injection in Phalcon Volt Engine

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 22, 2026·5 min read·126 visits

Executive Summary (TL;DR)

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.

Vulnerability Overview

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.

Root Cause Analysis

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.

Code Analysis

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 Methodology

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.

Impact Assessment

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.

Detection and 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.

Official Patches

PhalconFix join Volt filter parameter compilation

Fix Analysis (1)

Technical Appendix

CVSS Score
9.2/ 10
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

Affected Systems

Phalcon Framework (phalcon/cphalcon)

Affected Versions Detail

Product
Affected Versions
Fixed Version
cphalcon
Phalcon
<= 5.15.05.16.0
AttributeDetail
CWE IDCWE-94, CWE-1336
Attack VectorNetwork (AV:N)
CVSS v4.0 Score9.2 (Critical)
Exploit StatusPoC (Proof of Concept)
KEV StatusNot Listed
Affected ComponentVolt Template Compiler (join filter)

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
T1203Exploitation for Client Execution
Execution
CWE-94
Improper Control of Generation of Code ('Code Injection')

The application handles templates in a way that allows an attacker to inject source code which is later executed on the server.

References & Sources

  • [1]GitHub Security Advisory GHSA-hrwp-4hh9-c8r8
  • [2]GitHub Pull Request 17217
  • [3]Fix Commit e434061be3b7161930476c1368c868badc71e1bd
  • [4]Phalcon Release Tag 5.16.0

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 minutes ago•CVE-2026-109619
9.2

CVE-2026-109619: Remote Code Execution in PHP Core via Stale Global State Memory Corruption (PHP2Shell)

CVE-2026-109619 (PHP2Shell) is a critical Use-After-Free vulnerability in the core PHP engine caused by improper global state cleanup during out-of-memory exception handling across persistent worker requests.

Alon Barad
Alon Barad
1 views•6 min read
•5 minutes ago•CVE-2026-113721
4.5

CVE-2026-113721: Unsafe Link Resolution in virtualenv File Generation

In Python virtualenv prior to version 21.14.9, activation script generators and configuration writers use Path.exists() before writing files. Because Path.exists() resolves symbolic links, it returns False for dangling symlinks. Consequently, virtualenv skips unlinking pre-planted symbolic links or hard links, writing data directly to target locations outside the intended virtual environment directory.

Amit Schendel
Amit Schendel
1 views•5 min read
•9 days ago•CVE-2026-87697
8.8

CVE-2026-87697: Untrusted Deserialization in .NET PresentationCore Clipboard Handling

A remote code execution vulnerability exists in Microsoft .NET due to untrusted data deserialization within the PresentationCore component. The flaw stems from implicit auto-conversion flags during clipboard data retrieval operations.

Alon Barad
Alon Barad
31 views•5 min read
•9 days ago•CVE-2026-70007
8.8

CVE-2026-70007: Out-of-Bounds Write Vulnerability in .NET Framework and WPF Subsystem

An out-of-bounds write vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio allows unauthenticated remote attackers to execute arbitrary code via crafted pixel-shader bytecode or auto-converted clipboard payloads.

Amit Schendel
Amit Schendel
19 views•6 min read
•10 days ago•CVE-2026-70186
7.5

CVE-2026-70186: ASP.NET Core Denial of Service Vulnerability via Framework Deadlock

ASP.NET Core contains a thread deadlock vulnerability (CWE-833) that allows an unauthenticated remote attacker to cause a denial of service over the network by exhausting server thread pool resources.

Amit Schendel
Amit Schendel
18 views•5 min read
•10 days ago•CVE-2026-70035
8.8

CVE-2026-70035: Insecure Deserialization Remote Code Execution in Microsoft .NET Framework and .NET Runtime

CVE-2026-70035 is a high-severity Remote Code Execution (RCE) vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio caused by improper handling during the deserialization of untrusted data (CWE-502). An unauthenticated attacker can execute arbitrary code within the context of the affected process by delivering a crafted serialized payload.

Amit Schendel
Amit Schendel
24 views•6 min read