/

CVE-2025-59543

Severity:

CRITICAL RISK

(9.0)

Cross-Site Scripting (XSS) in Chamilo Course Description

CVE-2025-59543

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Account Takeover via Stored Cross-Site Scripting

Severity:

CRITICAL RISK

(9.0)

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

Chamilo versions prior to 1.11.34 contain a stored cross-site scripting (XSS) vulnerability in the course description field that allows low-privileged users to inject malicious JavaScript.

When other users, including administrators, view the affected course information page, the injected script executes in their browser, potentially leading to session theft and account takeover.

Affected context

This vulnerability appears in Chamilo learning management system deployments where:

  • Low-privileged users (such as trainers) can create or edit course descriptions.
  • The course description content is rendered on the course information page without robust output encoding or sanitization.
  • User browsers execute scripts in the same origin as the Chamilo application when viewing course information.

The issue becomes relevant in multi-user environments where users with differing privilege levels access shared course pages.

Exploit preconditions

  • Attack surface: Web interface, specifically the workflow for creating or editing course descriptions and viewing course information pages.
  • Required access: A valid low-privileged Chamilo account capable of editing the course description field (e.g., trainer or equivalent).
  • Trigger point: Any user, including administrators, browsing to the course information page that displays the stored, unsanitized course description.
  • Why exploitation is possible: User-controlled HTML/JavaScript content from the course description field is persisted server-side and later rendered into the page without proper contextual output encoding, enabling execution of attacker-supplied scripts in other users' browsers.

Why this happens

The underlying bug is a classic stored cross-site scripting issue, mapped to CWE-79: Improper Neutralization of Input During Web Page Generation.

The application stores user-supplied course description data and later includes it in HTML responses without consistently applying context-aware output encoding or HTML sanitization.

As a result, special characters and script-related constructs are interpreted by the browser as executable code instead of inert text.

The abstract pattern is: untrusted, persistent user input is embedded into a web page's DOM without neutralization, allowing scripts to execute in the application's origin.

Potential impact

  • Theft of session cookies or authentication tokens from users who view the compromised course page.
  • Account takeover of higher-privileged users, including administrators or course managers.
  • Execution of arbitrary JavaScript in victims' browsers, enabling actions on their behalf (e.g., changing settings, adding new users, modifying courses).
  • Unauthorized access to sensitive information displayed or accessible in the web UI.
  • Use of compromised accounts as a stepping stone for broader platform abuse or data exfiltration.

General mitigation guidance

Effective mitigation generally focuses on output encoding and strict handling of untrusted content:

  • Consistently apply context-aware output encoding for all user-controlled data rendered in HTML, attributes, JavaScript, or URLs.
  • Use a robust HTML sanitization library to strip or neutralize script-related elements and dangerous attributes from rich-text fields such as course descriptions.
  • Prefer safe-by-default templating frameworks that automatically escape variables unless explicitly marked as safe after sanitization.
  • Limit or carefully scope any feature that allows HTML input; when rich formatting is required, allow only a minimal, whitelisted subset of tags and attributes.
  • Enforce least-privilege principles for user roles so that compromised low-privileged accounts have restricted blast radius.
  • Consider enabling defense-in-depth browser-side protections such as a strict Content Security Policy (CSP) to reduce the impact of residual XSS issues.

How teams detect issues like this

Detection usually combines code inspection with automated checks:

  • Static analysis: Configure SAST tools to flag raw insertion of user-controlled variables into templates without passing through an escaping or sanitization function, particularly in views that render course descriptions.
  • Code review signals: During manual review, look for:
  • Direct concatenation of user input into HTML.
  • Use of frameworks' "unsafe" or "raw" output mechanisms.
  • Bypasses or disabling of sanitization filters for rich-text fields.
  • Dynamic testing: Employ DAST or browser-based scanners configured to test for stored XSS by injecting markers into persistent fields (like course descriptions) and checking later page loads.
  • Security policy enforcement: Integrate linting rules or pre-commit hooks that require contextual encoding for templated outputs and disallow inline script insertion patterns.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/releases/tag/v1.11.34
github.comgithub.com/chamilo/chamilo-lms/security/advisories/GHSA-p32q-6gh3-3gcv

Frequently asked

questions

Yes. Any attacker who can obtain a low-privileged Chamilo account and access the course description editing functionality can exploit the issue remotely through the web interface.

The attacker needs a valid low-privileged account (for example, a trainer) that is allowed to create or modify course descriptions. No direct access to administrator accounts is required.

The safest approach is to ensure all user-supplied content is either sanitized using a well-maintained whitelist-based HTML sanitizer before storage or consistently encoded in a context-aware way before rendering. Additionally, avoid rendering untrusted content using "raw" or "unsafe" template constructs.

Adopt a secure-by-default templating and encoding strategy, centralize sanitization logic for rich-text fields, enforce coding standards that require contextual escaping, and integrate automated security testing (SAST/DAST) into the development pipeline to catch XSS patterns before release.

Find out what's already
exploitable in your codebase.