CVE-2024-34004
📋 TL;DR
This vulnerability allows a Moodle user with wiki restore permissions and direct server access to execute local file includes in misconfigured shared hosting environments. It affects Moodle installations where users can access other users' content outside the webroot. The risk is limited to specific configurations with both permission and access requirements.
💻 Affected Systems
- Moodle
📦 What is this software?
Moodle by Moodle
Moodle by Moodle
Moodle by Moodle
⚠️ Risk & Real-World Impact
Worst Case
An attacker could include and execute arbitrary local files, potentially leading to remote code execution, data theft, or complete system compromise.
Likely Case
Limited file disclosure or inclusion of non-executable files due to the specific configuration requirements and access needed.
If Mitigated
No impact if proper file permissions and web server configurations prevent cross-user access.
🎯 Exploit Status
Requires authenticated user with specific permissions (wiki restore) and direct server access in misconfigured environment.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Check Moodle security releases for specific version
Vendor Advisory: https://moodle.org/mod/forum/discuss.php?d=458393
Restart Required: No
Instructions:
1. Update Moodle to the latest secure version. 2. Apply any security patches from Moodle. 3. Review and fix shared hosting configurations.
🔧 Temporary Workarounds
Restrict file permissions
linuxEnsure proper file permissions prevent users from accessing other users' content in shared hosting
chmod 750 /path/to/moodledata
chown www-data:www-data /path/to/moodledata
Web server configuration hardening
allConfigure web server to restrict access to directories outside webroot
# Apache: Ensure proper Directory restrictions
# Nginx: Use location blocks to restrict access
🧯 If You Can't Patch
- Review and correct shared hosting configurations to prevent cross-user file access
- Restrict wiki restore permissions to trusted administrators only
🔍 How to Verify
Check if Vulnerable:
Check if shared hosting allows users to access other users' files AND verify user has wiki restore permissions
Check Version:
Check Moodle version in Site administration > Notifications or via moodle/admin/index.php
Verify Fix Applied:
Confirm Moodle is updated to patched version and test that file inclusion attempts fail
📡 Detection & Monitoring
Log Indicators:
- Unusual file access patterns in web server logs
- Multiple failed file inclusion attempts
- Access to files outside expected directories
Network Indicators:
- HTTP requests attempting to include local files with unusual paths
SIEM Query:
web_server_logs WHERE (url CONTAINS '../' OR url CONTAINS 'file://') AND response_code = 200