Summary
Chamilo LMS contains an Insecure Direct Object Reference in the Learning Path progress saving endpoint, where a user ID parameter controls which user's progress is updated without proper ownership checks.
Any authenticated user enrolled in a course can tamper with another learner's scores, completion status, and time spent by modifying the uid parameter in the request.
Affected context
The vulnerability occurs in Chamilo LMS when handling Learning Path progress updates via the lp_ajax_save_item.php endpoint.
The endpoint accepts a uid parameter from $_REQUEST and uses it directly to load and update the progress record for that user in the context of a course.
When the application does not enforce that the authenticated user is the same as the user ID being updated, the access control model is effectively bypassed and cross-user progress manipulation becomes possible.
Exploit preconditions
- Attack surface: Web application HTTP interface, specifically the Learning Path progress saving AJAX endpoint.
- Required access: Authenticated user account with access to at least one course that uses Learning Paths.
- Trigger point: Sending a request to
lp_ajax_save_item.phpwith a manipulateduidparameter pointing to another enrolled user's ID. - Why exploitation is possible: The backend trusts the client-supplied
uidand performs no server-side authorization check to confirm that the caller is authorized to modify the target user's Learning Path progress.
Why this happens
The root cause aligns with CWE-639: Insecure Direct Object Reference, where the application exposes a direct reference to an internal object (another user's progress record) and relies on user-controlled identifiers without enforcing proper authorization.
In this case, lp_ajax_save_item.php takes the uid from $_REQUEST and uses it to select and update Learning Path progress data, but fails to verify that the authenticated session user matches the specified uid or otherwise has explicit permission to modify that user's records.
This pattern reflects a missing or incomplete access control check on a data-modifying operation, allowing horizontal privilege escalation between users in the same course.
Potential impact
- Course participants can modify other learners' scores on Learning Path activities.
- Users can falsely mark another learner's content as completed or not completed.
- Manipulation of recorded time spent, affecting progress tracking and analytics.
- Undermining of grading integrity and assessment reliability for instructors and institutions.
- Potential disputes or audit issues due to inaccurate learning history and records.
General mitigation guidance
Effective mitigation centers on enforcing server-side authorization checks for every operation that references user-specific resources.
Recommended hardening patterns include:
- Ignoring client-supplied user identifiers for self-service actions and deriving the effective user ID from the authenticated session or token.
- When cross-user administration is legitimate, enforcing role- and context-based checks (e.g., instructor, admin) before allowing updates to another user's progress.
- Implementing centralized access control helpers for Learning Path operations so that all read and write actions consistently verify ownership or privileges.
- Minimizing direct references to user IDs in client-controllable parameters; where necessary, validating that the identifier belongs to the current user within the current course.
- Logging sensitive state changes (e.g., score and completion updates) with actor, target user, and course context to support monitoring and investigations.
How teams detect issues like this
Detection typically involves a combination of code-level review and behavioral monitoring:
- Static analysis & code review: Flag endpoints that:
- Accept user IDs or object IDs from request parameters (
$_REQUEST, query string, POST body) and - Use them directly in data access/update queries without an accompanying authorization check tied to the authenticated session.
- Access control patterns: During review, trace how user-specific resources (like Learning Path progress) are loaded and updated, verifying that all modification paths go through a common authorization layer.
- Dynamic testing: Use test accounts to attempt horizontal privilege escalation by modifying IDs in Learning Path progress requests and observing whether cross-user data changes are possible.
- Logging and analytics: Monitor logs for suspicious patterns such as one account frequently updating Learning Path progress for multiple different user IDs without administrative roles.

