Summary
Chamilo LMS contains a stored cross-site scripting vulnerability in private messages because message content is rendered as HTML without sufficient server-side sanitization. An authenticated low-privilege user may send crafted content to an administrator, causing script execution when the administrator opens the message in the normal inbox or message view.
Affected context
The vulnerability occurs in Chamilo LMS deployments where authenticated users can compose messages addressed to other users and the resulting content is rendered in the recipient's browser. It is particularly risky when untrusted message content is displayed to administrators without context-aware output encoding or robust server-side sanitization.
Exploit preconditions
- Attack surface: Authenticated private-message functionality and recipient message-view pages
- Required access: A valid low-privilege account, including a student account
- Trigger point: The targeted recipient opens the message through the routine inbox or message view
- Why exploitation is possible: Message content can be stored and later rendered as executable browser content without adequate sanitization
Why this happens
The underlying bug is a failure to treat private-message content as untrusted data before rendering it as HTML. Because the application stores attacker-controlled content and inserts it into browser-rendered views without effective context-aware output encoding or sanitization, active script content may execute in the recipient's session. This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.
Potential impact
- An attacker may access session-related information available to browser scripts
- An attacker could perform actions with the privileges of the affected administrator
- Administrative settings or learning content could be modified
- User accounts, messages, or course data may be exposed or altered
- The vulnerability can facilitate broader compromise of the LMS environment
General mitigation guidance
Mitigation generally focuses on ensuring that user-authored message content cannot become executable browser code.
Common defensive patterns include:
- Applying robust server-side HTML sanitization using an allowlist appropriate for message content
- Encoding output according to the rendering context rather than relying only on client-side filtering
- Using secure-by-default templates that render messages as text unless explicitly approved markup is required
- Reducing trust in message content across all display paths, including legacy templates and client-side views
- Enforcing a restrictive Content Security Policy where practical
- Limiting administrative privileges and session capabilities to reduce the consequences of script execution
- Applying the vendor-provided security correction through the organization's normal change-management process
How teams detect issues like this
Organizations can look for stored XSS risks through:
- Static analysis rules identifying untrusted message fields rendered into HTML or template output
- Code review checks for missing context-aware escaping and incomplete server-side sanitization
- Testing message creation and display flows with inert XSS test markers in controlled environments
- Monitoring for unusual message content, unexpected administrative actions, and suspicious session activity
- Policy enforcement requiring approved sanitization libraries and secure template defaults
- Automated application security testing that covers both message submission and subsequent recipient rendering

