Summary
MaxSite CMS versions up to 109.1 contain a code injection vulnerability in the MarkItUp preview AJAX endpoint, where user-controlled data is passed into an eval-like function.
An attacker who can reach this endpoint over the network may inject and execute arbitrary code on the server, turning a simple content preview feature into a remote code execution vector.
Affected context
The vulnerability resides in application/maxsite/admin/plugins/editor_markitup/preview-ajax.php, which processes preview requests for the MarkItUp editor in MaxSite CMS.
It manifests when the endpoint evaluates request data directly, without adequate neutralization or restriction of the content being executed.
Installations that expose this AJAX endpoint over the network, especially in admin or editor workflows, are susceptible when untrusted or partially trusted input can reach the vulnerable function.
Exploit preconditions
- Attack surface: HTTP(S) requests targeting the MarkItUp preview AJAX endpoint in MaxSite CMS.
- Required access: Ability to send requests to the preview-ajax endpoint (often through an authenticated editing interface; exposure depends on the site's access controls and configuration).
- Trigger point: Submission of crafted content or parameters that are passed into the
evalfunction inpreview-ajax.php. - Why exploitation is possible: The endpoint uses an evaluation mechanism on request data without robust sanitization, encoding, or restriction, enabling injected code or expressions to be executed on the server.
Why this happens
This issue stems from using an eval-like function in PHP to process dynamic content in the MarkItUp preview endpoint.
Instead of treating user input as inert data (e.g., text to be formatted or rendered), the implementation implicitly trusts the data and evaluates it as executable code or code-fragment, mapping to CWE-94: Improper Control of Generation of Code.
Additionally, the vulnerability involves insufficient neutralization of input before it is included in a dynamically constructed command or expression, aligning with CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component.
The fundamental insecure pattern is blending user-controlled data with executable context, allowing attackers to cross the boundary between data processing and code execution.
Potential impact
- Execution of arbitrary PHP code in the context of the web server.
- Complete compromise of the affected CMS instance and its data.
- Access to database credentials and modification or exfiltration of content.
- Lateral movement within the hosting environment, potentially impacting other sites on the same server.
- Installation of backdoors or web shells, enabling persistent unauthorized access.
General mitigation guidance
Effective mitigation focuses on removing the dependency on eval-like semantics and confining user input to data-only processing paths:
- Replace any use of
evalor equivalent dynamic execution constructs with safer alternatives such as explicit parsing, whitelisting-based dispatch, or template rendering engines that treat input as data. - Strictly validate and normalize all parameters reaching the preview endpoint, ensuring only expected types, lengths, and formats are accepted.
- Use robust encoding and templating mechanisms when inserting user content into server-side processing pipelines, avoiding direct interpolation into code or expressions.
- Apply least-privilege principles to the CMS runtime: restrict file system permissions, database privileges, and the ability of the web server user to modify system files.
- Limit exposure of editor and preview endpoints to authenticated and authorized users only, and consider additional controls such as CSRF protection and rate limiting to reduce attack surface.
How teams detect issues like this
Organizations can identify and monitor this class of vulnerability through several high-level approaches:
- Static analysis: Configure rules to flag occurrences of
eval,create_function, dynamicinclude/require, or similar dynamic execution constructs, especially when concatenated with request variables ($_GET,$_POST,$_REQUEST). - Code review: During manual reviews, focus on preview, rendering, and plugin endpoints that transform user text; verify that user input is never directly executed or interpreted as code.
- Security testing: Incorporate dynamic application security testing (DAST) and fuzzing against AJAX and admin endpoints, looking for signs of code execution such as unexpected output, errors, or behavior changes when special characters and payload markers are supplied.
- Operational monitoring: Deploy web server and application logging with attention to anomalies in preview-related requests and responses; correlate unusual requests to file changes, new processes, or outbound connections from the web server.

