Summary
A Cross-Site Request Forgery (CSRF) vulnerability in Chamilo allows an attacker to trigger project deletion actions within a course without the trainer's explicit consent.
By luring an authenticated trainer to visit a malicious page, an attacker can cause unwanted project deletions due to missing CSRF tokens and unsafe use of GET-based state-changing requests.
Affected context
The vulnerability occurs in Chamilo's course management area, specifically around project deletion functionality.
It is relevant when:
- Trainers are authenticated in Chamilo via a web browser.
- The application performs sensitive actions (like deleting course projects) through GET requests.
- These actions do not include CSRF protections such as per-request tokens or same-site request validation.
In such environments, visiting external, attacker-controlled web pages while logged into Chamilo can unintentionally trigger administrative actions.
Exploit preconditions
- Attack surface: Web interface for course project management (project deletion endpoint).
- Required access: The victim must be an authenticated Chamilo user with privilege to delete projects (typically a trainer).
- Attacker position: Capable of hosting or injecting content into a web page or email that the victim will load in a browser.
- Trigger point: The victim's browser automatically sends a crafted GET request (e.g., via an image tag, script, iframe, or auto-submitting element) to the project deletion URL while the victim is logged in.
- Why exploitation is possible: The application relies solely on session cookies for authorization and performs sensitive state-changing actions via GET requests without verifying an anti-CSRF token, origin, or same-site constraints.
Why this happens
This vulnerability is rooted in missing CSRF defenses on a state-changing endpoint, aligning with CWE-352: Cross-Site Request Forgery (CSRF).
The project deletion action is exposed as an idempotent-looking GET request but actually mutates server-side state.
Because the server accepts any authenticated request without validating a CSRF token or the request origin, an attacker can embed the deletion URL in third-party content.
When the trainer's browser loads that content, it automatically sends the authenticated request using stored session cookies, causing unwanted deletion.
Abstractly, the insecure pattern is:
- Sensitive operations (create, update, delete) invoked via browser-friendly URLs.
- Authorization tied only to session cookies with no additional per-request proof of user intent.
- Missing or ineffective validation of request provenance (token, origin, or same-site checks).
Potential impact
- Deletion of course projects without the trainer's knowledge.
- Loss of associated project data, assignments, and collaboration history.
- Disruption of teaching workflows and course planning.
- Potential reputational damage if students' work is lost or mishandled.
- Additional confusion or administrative overhead as staff attempt to restore or recreate deleted content.
General mitigation guidance
Effective mitigation focuses on enforcing explicit user intent for all state-changing operations.
Common defensive patterns include:
- CSRF tokens on sensitive actions: Require unpredictable, per-session or per-request tokens on all create/update/delete operations and validate them server-side.
- Avoid state changes via GET: Use POST (or other non-GET verbs) for operations that modify state, and treat GET requests as safe, read-only operations.
- Origin and SameSite enforcement: Consider validating the
Origin/Refererheaders for high-value endpoints and configure cookies with appropriateSameSiteattributes where compatible. - User interaction checks: For destructive actions such as deletion, introduce confirmation steps (dialogs, re-auth, or explicit opt-in) to strengthen intent verification.
- Principle of least privilege: Ensure only appropriate roles (e.g., trainers) can delete projects, reducing the impact scope if CSRF is triggered.
How teams detect issues like this
Organizations can look for CSRF risks in Chamilo-like applications using multiple approaches:
- Static analysis and linters: Flag endpoints that perform state-changing operations via GET or lack CSRF validation calls in the controller/service layer.
- Security-focused code review: During review, treat any delete/modify operation as suspicious if it:
- Uses GET or a form without a CSRF token.
- Does not validate anti-CSRF tokens or request origin.
- Automated testing and DAST: Use dynamic scanners configured to probe CSRF on sensitive actions (creation, update, deletion) and identify missing token protections.
- Policy enforcement in CI/CD: Enforce patterns such as "no state-changing GET endpoints" and "all POST forms must include a CSRF token," with automated checks blocking non-compliant changes.

