Chamilo LMS — Authentication Bypass and Cross-Site Scriptin
An authentication bypass in Chamilo LMS allowed unauthenticated users to store data by setting a user identifier to zero, which matched the session check. This enabled a stored cross-site scripting attack that executed in other users' browsers.
Published on infosecwriteups.com
The Chamilo LMS platform, widely used in educational environments, has been identified with an authentication bypass vulnerability that allows attackers to circumvent access control mechanisms. This vulnerability facilitates the exploitation of a second Cross-Site Scripting (XSS) vulnerability, which can have serious…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The permission check treated an unauthenticated session (user ID 0) as a valid match when the supplied user ID was also 0, and stored values were returned without XSS filtering.
Impact
An unauthenticated attacker could store a script that executes in the browsers of other users viewing the stored data, potentially compromising their sessions and information.
What the attacker needed
No authentication required; victim views the stored data
The fix
The vendor fixed it by requiring the supplied user ID to be non-empty and by filtering stored values with an XSS removal function before returning them.
How it was found
- Send a request to the storage API with action set, user and course identifiers set to zero, and a malicious script in the key parameter.
- Send a request to the storage API with action getall and the same zero identifiers to confirm the stored script is returned.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The software checked whether a user was allowed to save data by comparing the supplied user ID with the logged-in user's ID. When nobody was logged in, the logged-in ID was zero, so sending zero as the user ID made the check pass. The saved data was then shown to other users without proper cleaning, letting an attacker run a script in their browsers.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.