Chamilo LMS Authenticated RCE via Unrestricted File Upload — CVE-2026-29041
by MENG HOKSENG · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-29041
- Category
- web
- Affected product
- Chamilo LMS
- Affected versions
- 1.11.32 (confirmed)
- Disclosed
- 2026-07-05
- Patch status
- unpatched
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-03 |
| Author / Researcher | MENG HOKSENG |
| CVE / Advisory | CVE-2026-29041 |
| Category | web |
| Severity | High |
| CVSS Score | 8.8 (HIGH) — CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (as stated in source README) |
| Status | Weaponized |
| Tags | chamilo, lms, file-upload, rce, webshell, cwe-434, mime-bypass, authenticated |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Chamilo LMS |
| Versions Affected | 1.11.32 (confirmed) |
| Language / Platform | Python PoC (requests) against a PHP web application |
| Authentication Required | Yes — low-privileged Student role |
| Network Access Required | Yes |
Summary
Chamilo LMS’s ck_uploadimage AJAX endpoint (main/inc/ajax/document.ajax.php?a=ck_uploadimage) validates uploaded files solely by inspecting magic bytes via PHP’s mime_content_type(), without checking the file extension or sanitizing the stored filename. An attacker can prepend the GIF89a magic-byte header to a PHP web shell so the file is classified as image/gif, while the server still stores it with its original attacker-chosen .php extension inside a web-accessible upload directory. Because a low-privileged Student account can reach this endpoint, the PoC logs in as a student, uploads a disguised PHP web shell, and then issues commands to the shell via a cmd GET parameter, achieving full remote code execution on the server.
Vulnerability Details
Root Cause
The upload handler performs MIME-type validation only (via magic bytes), never validates the file extension, and preserves the attacker-supplied filename when saving to a directory served directly by the web server, allowing a .php file with faked image magic bytes to be uploaded and executed.
Attack Vector
- Authenticate to Chamilo as a low-privileged Student account.
- POST a file to
main/inc/ajax/document.ajax.php?a=ck_uploadimage&cidReq=<course>whose content begins withGIF89a;followed by PHP code (<?php system($_GET['cmd']); ?>) and whose filename ends in.php. - The MIME check passes (
image/gifdetected from magic bytes) and the file is stored underapp/upload/users/<id>/...with its.phpextension intact. - Request the stored file directly via HTTP with a
?cmd=<command>parameter to execute arbitrary OS commands through the planted web shell.
Impact
Full remote code execution on the LMS server from a Student-level account, leading to complete loss of confidentiality, integrity, and availability (database/credential access, lateral movement, persistence, content tampering).
Environment / Lab Setup
Target: Chamilo LMS 1.11.32
Attacker: Python 3 with `requests`, valid student credentials on the target
Proof of Concept
PoC Script
See
cvd-10-10.pyin this folder.
| |
The script logs into Chamilo as the given student, uploads a PHP web shell disguised with a GIF89a image header via the ck_uploadimage endpoint, then opens an interactive shell prompt that sends commands to the planted web shell’s cmd parameter and prints the output.
Detection & Indicators of Compromise
Signs of compromise:
- Presence of unexpected
.phpfiles underapp/upload/users/*/directories. - Repeated GET requests to uploaded files carrying a
cmdparameter. - Student accounts making POST requests to the document AJAX upload endpoint outside normal course material workflows.
Remediation
| Action | Detail |
|---|---|
| Primary fix | No vendor patch confirmed as of 2026-07-05 — monitor for advisory; enforce strict file-extension allowlisting rejecting .php/.phtml/.phar regardless of MIME type. |
| Interim mitigation | Store uploads outside web-accessible directories or serve them through a controlled handler that strips/ignores executable extensions; disable PHP execution in upload directories via web server config. |
References
Notes
Mirrored from https://github.com/celeboy711-hue/CVE-2026-29041 on 2026-07-05.
| |