/

CVE-2025-52482

Severity:

HIGH RISK

(8.3)

Stored XSS in Chamilo Glossary Function

CVE-2025-52482

Analyzed

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Privilege Escalation via Client-Side Code Execution

Severity:

HIGH RISK

(8.3)

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's glossary feature contained a stored cross-site scripting (XSS) issue that allowed teachers to persistently inject malicious JavaScript code.

When an administrator later viewed the compromised glossary entries, the attacker-controlled script could execute in the admin's browser, potentially leading to account takeover and unauthorized actions within the LMS.

Affected context

The vulnerability arises in Chamilo installations where the glossary function is enabled and teachers are allowed to create or edit glossary entries.

Malicious content is stored server-side and rendered in views accessible to higher-privileged users, such as administrators.

The issue manifests when the application fails to neutralize or encode user-supplied glossary terms or descriptions before displaying them in HTML pages.

Exploit preconditions

  • Attack surface: Web interface of the Chamilo LMS, specifically the glossary management and viewing pages.
  • Required access: An authenticated account with at least Teacher-level privileges capable of adding or modifying glossary entries.
  • Trigger point: A privileged user (e.g., administrator) visits a page that displays the stored glossary entry containing injected script.
  • Why exploitation is possible: The glossary feature stores user-provided HTML/markup without sufficient output encoding or sanitization, allowing embedded scripts to execute in the browser of any user who views the content.

Why this happens

The core issue maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The glossary component accepts user-controlled text from teachers and later renders it into HTML responses without robust output encoding, HTML filtering, or content sanitization.

Because the application treats this content as trusted when generating pages for other users, including administrators, embedded script elements or event handlers are interpreted by the browser as active JavaScript rather than inert text.

This pattern—storing untrusted input and reusing it across views without appropriate context-aware escaping—is characteristic of stored XSS vulnerabilities.

Potential impact

  • Execution of arbitrary JavaScript in the administrator's browser session.
  • Theft of administrator session tokens or other sensitive browser-stored data.
  • Unauthorized administrative actions performed via the admin's session (e.g., creating accounts, changing configurations).
  • Defacement or manipulation of LMS content visible to many users.
  • Lateral movement to other internal systems if the admin's browser has access to additional applications or management consoles.

General mitigation guidance

Effective mitigation focuses on treating all user-supplied content as untrusted and enforcing strict output encoding:

  • Apply context-aware output encoding (HTML, attribute, JavaScript) to all glossary fields before rendering them in templates.
  • Use a well-maintained HTML sanitization library to remove or neutralize scripts, event handlers, and dangerous attributes from rich text fields.
  • Prefer a whitelist-based approach for allowed HTML tags and attributes, or disable raw HTML entirely in glossary entries.
  • Enforce a secure templating system that automatically escapes variables by default, only allowing explicit, reviewed exceptions.
  • Restrict the privileges associated with Teacher roles to the minimum necessary and separate high-risk content authoring from administrative views where possible.

How teams detect issues like this

Organizations can identify similar XSS issues through a combination of testing and code analysis:

  • Static analysis: Look for templates or view functions that interpolate user-controlled glossary fields directly into HTML without encoding or sanitization.
  • Code review: Flag any use of raw HTML output, disabled escaping, or custom rendering paths for glossary or other content fields.
  • Dynamic testing: Use web security scanners and manual penetration testing to submit XSS test payloads in glossary entries and confirm whether they execute when viewed by other roles.
  • Security policies: Enforce development guidelines requiring context-aware escaping and standardized sanitization libraries for all user-generated content components.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/commit/241c569dde0ad0e34d558ae51271f70438189b0e
github.comgithub.com/chamilo/chamilo-lms/commit/82cc07edd8ef316e6b36da7c501120d5c0aeb151
github.comgithub.com/chamilo/chamilo-lms/commit/f9150075246df4ed9755a4a150e25edb468767be
github.comgithub.com/chamilo/chamilo-lms/releases/tag/v1.11.30
github.comgithub.com/chamilo/chamilo-lms/security/advisories/GHSA-4wcp-3rh3-7wm4

Frequently asked

questions

Yes. Any attacker who can obtain a Teacher-level account, or compromise one, can exploit the vulnerability over the network by crafting malicious glossary entries that will be executed in an administrator's browser.

The attacker needs authenticated Teacher-level access or equivalent permissions that allow creating or editing glossary entries. Guest or student users without glossary edit rights cannot directly exploit this specific flaw.

The most robust approach is to apply context-aware output encoding by default and use a vetted sanitization library for any user-generated HTML. Templates should not render raw user input; instead, they should escape all variables unless there is a strong, reviewed justification not to.

Adopt a secure coding standard that mandates automatic escaping in templating engines, centralized sanitization utilities for rich text, and security-focused code reviews for any feature that stores and redisplays user input. Complement this with automated static analysis and routine application security testing aimed at detecting XSS patterns.

Find out what's already
exploitable in your codebase.