CVE-2023-4221
📋 TL;DR
This vulnerability allows authenticated users with Learning Path upload permissions to execute arbitrary commands on the server through command injection in the OpenOffice presentation processing component. Attackers can achieve remote code execution by exploiting improper input sanitization in the file upload functionality. Only Chamilo LMS installations with users who have Learning Path upload privileges are affected.
💻 Affected Systems
- Chamilo LMS
📦 What is this software?
Chamilo Lms by Chamilo
⚠️ Risk & Real-World Impact
Worst Case
Full server compromise allowing attackers to execute arbitrary commands with web server privileges, potentially leading to data theft, lateral movement, or complete system takeover.
Likely Case
Authenticated attackers gaining shell access to the web server, allowing them to read sensitive files, modify content, or establish persistence on the system.
If Mitigated
Limited impact if proper input validation and command sanitization are implemented, restricting attackers to file upload operations only.
🎯 Exploit Status
Exploitation requires authenticated access with Learning Path upload permissions. The vulnerability is in a file processing component that handles uploaded presentations.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: v1.11.25 and later
Restart Required: No
Instructions:
1. Update to Chamilo LMS v1.11.25 or later. 2. Apply the security patches from the GitHub commits. 3. Verify the fix by checking that the vulnerable file has been updated.
🔧 Temporary Workarounds
Disable Learning Path uploads
allTemporarily disable Learning Path upload functionality for all users
Modify Chamilo configuration to remove Learning Path upload permissions
Input validation enhancement
allAdd additional input validation for file upload parameters
Implement strict whitelist validation for uploaded file names and parameters
🧯 If You Can't Patch
- Restrict Learning Path upload permissions to trusted administrators only
- Implement web application firewall rules to block command injection patterns in upload requests
🔍 How to Verify
Check if Vulnerable:
Check if Chamilo version is <= 1.11.24 and review main/lp/openoffice_presentation.class.php for vulnerable code patterns
Check Version:
Check Chamilo version in the administration panel or review the main/inc/conf/configuration.php file
Verify Fix Applied:
Verify the file main/lp/openoffice_presentation.class.php contains the security patches from the GitHub commits
📡 Detection & Monitoring
Log Indicators:
- Unusual command execution patterns in web server logs
- Multiple failed upload attempts with special characters
- Suspicious file uploads to Learning Path components
Network Indicators:
- HTTP POST requests to Learning Path upload endpoints containing shell metacharacters
- Outbound connections from web server to unexpected destinations
SIEM Query:
source="web_server_logs" AND (url="*openoffice_presentation*" OR url="*lp/*") AND (method="POST") AND (payload="*;*" OR payload="*|*" OR payload="*`*" OR payload="*$(*")
🔗 References
- https://github.com/chamilo/chamilo-lms/commit/841a07396fed0ef27c5db13a1b700eac02754fc7
- https://github.com/chamilo/chamilo-lms/commit/ed72914608d2a07ee2eb587c1a654480d08201db
- https://starlabs.sg/advisories/23/23-4221
- https://support.chamilo.org/projects/chamilo-18/wiki/security_issues#Issue-128-2023-09-04-Critical-impact-Moderate-risk-Authenticated-users-may-gain-unauthenticated-RCE-CVE-2023-4221CVE-2023-4222
- https://github.com/chamilo/chamilo-lms/commit/841a07396fed0ef27c5db13a1b700eac02754fc7
- https://github.com/chamilo/chamilo-lms/commit/ed72914608d2a07ee2eb587c1a654480d08201db
- https://starlabs.sg/advisories/23/23-4221
- https://support.chamilo.org/projects/chamilo-18/wiki/security_issues#Issue-128-2023-09-04-Critical-impact-Moderate-risk-Authenticated-users-may-gain-unauthenticated-RCE-CVE-2023-4221CVE-2023-4222