Summary
ImpressCMS contains an authenticated remote code execution vulnerability in its custom tag module when PHP-enabled tags process attacker-controlled content. An authenticated administrator may store a malicious payload that is decoded and evaluated as PHP, causing code execution when frontend pages trigger the tag.
Affected context
The vulnerability occurs in ImpressCMS deployments that enable the custom tag module's PHP processing capability. It becomes risky when an authenticated administrator can create or modify PHP-enabled custom tags and the resulting content is rendered through the frontend preload event system. HTML encoding and sanitization do not provide a sufficient boundary when content is later decoded and passed to a PHP evaluation routine.
Exploit preconditions
- Attack surface: ImpressCMS custom tag administration and frontend rendering
- Required access: Authenticated administrative privileges capable of creating or modifying custom tags
- Trigger point: Frontend page processing through the custom tag preload event
- Why exploitation is possible: HTML-encoded content is decoded before being passed to
eval()when PHP-type custom tags are rendered, allowing stored input to be interpreted as executable PHP
Why this happens
The underlying bug is the execution of stored, user-influenced content as PHP code. The custom tag rendering path reverses HTML encoding with undoHtmlSpecialChars() and then passes the result to eval() in renderWithPhp(). This creates a code injection condition mapped to CWE-94, because data that should remain content is treated as executable program logic; sanitization performed before decoding does not reliably constrain the later execution context.
Potential impact
- An attacker with the required administrative access may execute arbitrary PHP code
- The application process could be compromised
- Confidential application data may be read or modified
- Content, accounts, or configuration may be altered
- The host or connected services could be exposed to further compromise
General mitigation guidance
Mitigation generally focuses on eliminating dynamic PHP evaluation from
user-managed content and reducing trust in administrative input.
Common defensive patterns include:
- Replacing
eval()-based rendering with a constrained template or markup system - Disabling PHP execution in custom tags unless there is a narrowly justified need
- Applying context-appropriate validation after decoding and before rendering
- Treating stored custom-tag content as data rather than executable logic
- Separating content-management privileges from code-execution privileges
- Running the application with least-privilege filesystem, database, and operating-system permissions
- Auditing existing PHP-enabled custom tags and reviewing administrative activity
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying
eval()and other dynamic code execution APIs - Code review checks for decoding, sanitization, or normalization followed by execution
- Searches for render paths that interpret database-backed content as PHP
- Tests confirming that encoded or malformed content remains inert after all transformations
- Policy enforcement that prohibits executable content in configurable CMS fields
- Monitoring for unexpected custom-tag changes and unusual application-process behavior
Automated code review and software composition tools may help identify dangerous execution patterns, but should be supplemented with manual data-flow analysis.

