/

CVE-2025-59541

Severity:

HIGH RISK

(8.1)

CSRF in Chamilo Course Project Deletion

CVE-2025-59541

Analyzed

Vulnerability type

Category:

Cross-Site Request Forgery (CSRF)

CWE:

CWE-352

Impact:

Unauthorized Action Execution on Behalf of Authenticated Users

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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/Referer headers for high-value endpoints and configure cookies with appropriate SameSite attributes 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.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/releases/tag/v1.11.34
github.comgithub.com/chamilo/chamilo-lms/security/advisories/GHSA-rpj6-p9m5-q637

Frequently asked

questions

Yes. An attacker can exploit it remotely by convincing an authenticated trainer to visit a malicious page or open crafted content while logged into Chamilo. The attacker does not need direct access to the Chamilo instance itself.

The attacker does not need an account with delete permissions; instead, they rely on the victim's existing privileges. The victim must be logged in as a user who can delete projects (such as a trainer), and their browser must automatically send session cookies.

The most reliable fix is to require strong CSRF defenses on all state-changing endpoints:

  • Move destructive actions (like deletion) away from GET to POST or other non-GET methods.
  • Enforce CSRF tokens that must be present and valid for the request to proceed.
  • Pair this with confirmation steps for high-risk operations.

Bake CSRF protection into the framework and development process:

  • Use built-in CSRF middleware or libraries and apply them globally.
  • Establish coding standards: no state-changing logic on GET, and all modifying requests must include a validated CSRF token.
  • Educate developers on CSRF patterns and incorporate automated checks in CI/CD to block new endpoints that violate these rules.
Find out what's already
exploitable in your codebase.