Summary
FuelCMS v1.5.2 contains a code injection flaw in the /parser/dwoo component that allows crafted PHP code to be executed by the application.
When attacker-controlled input is interpreted as PHP within the template parser, it can lead to arbitrary code execution on the server under vulnerable configurations.
Affected context
This vulnerability affects FuelCMS v1.5.2 deployments that rely on the Dwoo-based parser for rendering templates or dynamic content.
It becomes relevant when user-supplied or otherwise low-trust data is passed—directly or indirectly—into the /parser/dwoo rendering path without adequate separation between data and executable PHP code.
Environments that allow administrators, content editors, or integrations to define or modify templates, snippets, or dynamic content fields are particularly exposed if those inputs are evaluated as PHP.
Exploit preconditions
- Attack surface: Web interface or API endpoints that trigger the /parser/dwoo rendering logic
- Required access: Ability to inject or control content that is processed by the Dwoo parser (e.g., template fields, content blocks, or configuration entries)
- Trigger point: Rendering of a template or content block where the crafted input is interpreted as PHP code by the parser component
- Why exploitation is possible: The parser evaluates or includes PHP code derived from user-controllable data, rather than strictly treating it as inert content, allowing attacker-provided code to be executed within the application context
Why this happens
The underlying issue corresponds to CWE-94: Improper Control of Generation of Code ('Code Injection').
The /parser/dwoo component appears to blur the boundary between data and executable code, allowing template or content inputs to be transformed into PHP that is subsequently evaluated or executed.
This design pattern makes the parser trust input as code instead of data, so when an attacker can influence what is rendered, they can introduce arbitrary PHP constructs that the server runs with the application's privileges.
Potential impact
- Execution of arbitrary PHP code on the web server
- Complete compromise of the CMS application and underlying data
- Installation of webshells or backdoors for persistent access
- Access to sensitive configuration values, including database credentials and API keys
- Lateral movement within the hosting environment, depending on server configuration and privileges
General mitigation guidance
Effective mitigation centers on eliminating the ability for untrusted data to be interpreted as executable PHP by the parser.
Recommended patterns include:
- Treat all template inputs and dynamic content as data only, never as PHP code, and avoid APIs that evaluate content as PHP.
- Introduce a strict separation between template authorship (trusted, tightly controlled) and runtime data (potentially untrusted).
- Constrain the template language to a safe, declarative subset that does not directly map to raw PHP execution primitives.
- Apply robust output encoding for variables rendered within templates so that unexpected PHP constructs cannot be formed from user input.
- Run the application and webserver with least-privilege accounts and restrict filesystem write access to reduce post-exploitation impact.
How teams detect issues like this
Detection strategies generally focus on identifying dynamic code execution paths that originate from variable or user-controlled input:
- Use static analysis to flag calls that evaluate or include PHP generated from variables (e.g., dynamic
eval,includepatterns) within the /parser/dwoo code path. - During code review, look for template rendering logic that directly embeds raw PHP or allows template authors to write PHP-like constructs instead of using a safe templating syntax.
- Implement application-level policies that prohibit dynamic evaluation of template content and enforce the use of a restricted template engine configuration.
- Apply runtime monitoring and logging for suspicious template input patterns, unexpected file modifications, or anomalous PHP function usage that indicate possible code injection.

