CVE-2023-3545
📋 TL;DR
This vulnerability allows unauthenticated attackers to bypass file upload security in Chamilo LMS on Windows/Apache systems by uploading a malicious .htaccess file. Attackers can achieve remote code execution, potentially taking full control of affected systems. All Chamilo LMS installations up to version 1.11.20 running on Windows with Apache are vulnerable.
💻 Affected Systems
- Chamilo LMS
📦 What is this software?
Chamilo by Chamilo
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise with remote code execution, allowing attackers to install malware, steal data, pivot to other systems, or disrupt operations.
Likely Case
Unauthenticated attackers achieve remote code execution, leading to data theft, ransomware deployment, or creation of persistent backdoors.
If Mitigated
Attackers may still upload malicious files but cannot execute them due to proper file permission restrictions and web server hardening.
🎯 Exploit Status
Exploitation is straightforward and can be chained with CVE-2023-3533 for easier file upload. Public exploit details are available in security advisories.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: v1.11.21 and later
Restart Required: No
Instructions:
1. Backup your Chamilo installation and database. 2. Download the latest version from https://github.com/chamilo/chamilo-lms. 3. Replace the vulnerable file main/inc/lib/fileUpload.lib.php with the patched version. 4. Verify the fix by checking the file contains proper .htaccess validation.
🔧 Temporary Workarounds
Restrict .htaccess file uploads
allBlock uploads of .htaccess files at the web server or application level
# Apache configuration: Add to .htaccess or httpd.conf
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
# Application-level: Add to file upload validation
if (preg_match('/^\.ht/', $filename)) {
reject_upload();
}
Disable file upload functionality
allTemporarily disable file uploads in Chamilo LMS if not essential
# Edit Chamilo configuration to disable uploads
# Set upload_max_filesize = 0 in php.ini
# Or disable upload features in Chamilo admin panel
🧯 If You Can't Patch
- Implement strict file upload validation that rejects any file starting with .ht
- Configure web server to deny execution of uploaded files in the upload directory
🔍 How to Verify
Check if Vulnerable:
Check if Chamilo version is <= 1.11.20 and running on Windows/Apache. Examine main/inc/lib/fileUpload.lib.php for proper .htaccess file validation.
Check Version:
Check Chamilo version in app/cache/version.php or via admin panel
Verify Fix Applied:
Verify the patched fileUpload.lib.php properly validates and rejects .htaccess file uploads. Test uploading a .htaccess file should be blocked.
📡 Detection & Monitoring
Log Indicators:
- Multiple failed .htaccess file upload attempts
- Successful .htaccess file uploads in upload directory
- Unusual PHP file execution from upload directories
Network Indicators:
- HTTP POST requests to file upload endpoints with .htaccess files
- Subsequent requests to uploaded malicious files
SIEM Query:
source="apache_access" AND (uri="/main/inc/lib/fileUpload.lib.php" OR uri="/main/upload/" OR filename="*.htaccess")
🔗 References
- https://github.com/chamilo/chamilo-lms/commit/dc7bfce429fbd843a95a57c184b6992c4d709549
- https://starlabs.sg/advisories/23/23-3545/
- https://support.chamilo.org/projects/chamilo-18/wiki/security_issues#Issue-125-2023-07-13-Critical-impact-Moderate-risk-Htaccess-File-Upload-Security-Bypass-on-Windows-CVE-2023-3545
- https://github.com/chamilo/chamilo-lms/commit/dc7bfce429fbd843a95a57c184b6992c4d709549
- https://starlabs.sg/advisories/23/23-3545/
- https://support.chamilo.org/projects/chamilo-18/wiki/security_issues#Issue-125-2023-07-13-Critical-impact-Moderate-risk-Htaccess-File-Upload-Security-Bypass-on-Windows-CVE-2023-3545