Summary
Cotonti 1.0.0 contains a Cross-Site Request Forgery flaw in the administration rights handler that allows unauthorized changes to group access permissions.
If an authenticated administrator is tricked into loading a malicious page, the attacker can silently submit forged requests that grant elevated rights to an attacker-controlled group, potentially leading to full administrative takeover and remote code execution.
Affected context
The vulnerability appears in the Cotonti CMS administration interface, specifically in the rights management functionality (system/admin/admin.rights.php).
It becomes relevant in deployments where:
- Administrator sessions are active in a browser that can execute attacker-supplied HTML or JavaScript (e.g., via a separate tab, phishing email, or compromised site).
- The rights update endpoint (
a=update) is reachable over the network and relies on cookies or similar ambient credentials. - No additional confirmation or CSRF validation is enforced when adjusting group access rights.
In such environments, the browser may unknowingly submit state-changing requests on behalf of the administrator.
Exploit preconditions
- Attack surface: HTTP POST/GET endpoint for administration rights updates (
admin.rights.php?a=update). - Required access:
- The attacker does not need direct access to the admin panel.
- An administrator must be authenticated to Cotonti in the same browser session.
- Trigger point:
- The victim administrator is lured into visiting an attacker-controlled web page (or another compromised site) while logged in.
- The page issues crafted requests to the rights update endpoint (e.g., via form auto-submit or hidden requests).
- Why exploitation is possible:
- The rights update action modifies group access rights without verifying an anti-CSRF token (no
cot_check_xg()call). - Browsers automatically attach existing session cookies to cross-origin requests, so the application cannot distinguish the forged request from a legitimate admin action.
Why this happens
The root cause is a missing server-side verification of request authenticity for a state-changing operation in the admin panel.
Specifically, the rights update action in system/admin/admin.rights.php updates group permissions (including via cot_auth_add_group) without performing a CSRF token check using cot_check_xg().
This aligns with CWE-352: Cross-Site Request Forgery (CSRF), where the application relies solely on ambient credentials (cookies, session IDs) and does not require a per-request, unguessable token or equivalent confirmation for sensitive actions.
As a result, the browser becomes a confused deputy: it sends authenticated requests initiated from an untrusted origin, and the server treats them as legitimate administrative operations.
Potential impact
- Attacker-controlled group may be granted elevated access rights, up to full administrative privileges.
- Unauthorized modification of site configuration, plugin settings, and access control lists.
- Template and content manipulation that can introduce backdoors or malicious code.
- Indirect remote code execution via template editing, plugin configuration, or file upload features accessible to administrators.
- Long-term compromise of the CMS instance, including creation of hidden admin accounts or persistent malicious groups.
General mitigation guidance
Effective mitigation focuses on enforcing strong request authenticity checks and minimizing the impact of any single administrative action:
- Require a robust anti-CSRF mechanism (per-request, unpredictable tokens) for all state-changing admin operations, especially rights and configuration updates.
- Centralize CSRF validation in reusable helpers and ensure all privileged handlers invoke them before processing updates.
- Favor POST (or other non-idempotent) methods with CSRF tokens and avoid performing sensitive changes via GET requests.
- Introduce explicit confirmation steps or re-authentication for high-risk actions such as granting admin-level rights or modifying templates.
- Apply least-privilege principles to admin roles and groups so that not all accounts can directly gain full system control.
- Consider separating configuration/template editing capabilities into a more restricted administrative tier.
These patterns reduce the risk of CSRF across the application and limit the blast radius if a single endpoint is misconfigured.
How teams detect issues like this
High-level detection typically combines code-level review with security testing:
- Static analysis and code review:
- Search for admin controllers or handlers that update permissions, roles, or configuration and verify that each calls a central CSRF validation routine (e.g.,
cot_check_xg()). - Flag any state-changing actions in the admin area that do not validate a CSRF token, or that accept changes over GET without additional safeguards.
- Review form templates to ensure they include and correctly propagate CSRF tokens.
- Security testing and QA:
- Perform manual or automated CSRF testing for administrative endpoints by crafting cross-origin forms or XHR requests and observing whether changes are applied.
- Use security scanners or CI-integrated tools that highlight missing CSRF protections on sensitive routes.
- Policy and governance:
- Enforce secure coding guidelines that mandate CSRF protection for all non-idempotent endpoints.
- Include checks for CSRF coverage in pull-request templates and automated code review workflows.

