Summary
CMSimple 5.24 disables CSRF protection by default and does not include CSRF tokens in administrative forms, allowing an unauthenticated attacker to forge a content-saving request through a logged-in administrator's browser. Because submitted content is later processed by an evaluative scripting mechanism, the stored marker may result in persistent remote code execution for subsequent visitors.
Affected context
The vulnerability occurs in CMSimple installations where administrator authentication relies on cookies, CSRF protection remains disabled, and state-changing administrative forms omit enforceable anti-CSRF tokens. Risk is increased when saved content is later passed to an evaluative scripting function that executes embedded server-side logic during page rendering.
Exploit preconditions
- Attack surface: Administrative content-saving functionality exposed through a web browser
- Required access: No direct CMS authentication is required; the attacker must be able to cause a logged-in administrator to visit or load attacker-controlled content
- Trigger point: A forged state-changing content request processed by the CMS
- Why exploitation is possible: Cookie-only authentication permits the administrator's browser to submit authenticated requests, while disabled CSRF checks do not distinguish legitimate forms from cross-origin forged requests
- Post-condition: The submitted content is stored and later interpreted by the server-side scripting evaluation path
Why this happens
The primary flaw is a missing request-integrity control: state-changing administrative requests accept ambient authentication cookies without requiring a request-specific CSRF token. This maps to CWE-352: Cross-Site Request Forgery, because an external origin can cause a victim's authenticated browser to perform an unintended action.
The impact is amplified by unsafe handling of stored content. Content is retained verbatim and later passed to an evaluative PHP execution mechanism, creating a code-injection path after the forged update succeeds. The combination of request forgery and server-side evaluation can therefore turn a content modification into persistent code execution.
Potential impact
- An attacker may alter or deface website content
- Malicious server-side logic could execute under the web server account
- The compromise could affect authenticated and unauthenticated visitors
- Sensitive application data or configuration could be exposed
- The hosting environment could be used for further compromise or persistence
General mitigation guidance
Mitigation generally focuses on enforcing request integrity and eliminating executable interpretation of stored content.
Common defensive patterns include:
- Enabling CSRF protection by default for every state-changing administrative request
- Generating, embedding, and validating unpredictable per-session or per-request CSRF tokens
- Applying origin or referer validation as a complementary control, rather than as the sole defense
- Replacing server-side evaluation of content with a safe, non-executable rendering model
- Treating administrator-submitted content as data and applying strict allowlisted validation
- Using separate privileges for web-server processes and limiting their ability to modify application files
- Applying secure cookie attributes and requiring reauthentication for especially sensitive administrative actions
How teams detect issues like this
Organizations can assess for this class of issue through:
- Static analysis searches for state-changing routes that lack CSRF middleware or token validation
- Code review checks confirming that every administrative form includes an unpredictable token and that the server verifies it
- Searches for dynamic evaluation functions, such as PHP
eval(), applied to stored or request-derived content - Dynamic tests that submit administrative requests without valid CSRF tokens and verify that they are rejected
- Browser-based security tests that attempt cross-origin form submission against authenticated sessions
- Policy enforcement preventing executable content from being stored in user-editable CMS fields
Automated application-security and code-review tools may help identify missing request protections and dangerous evaluation patterns.

