CVE-2024-34004

6.5 MEDIUM

📋 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

Products:
  • Moodle
Versions: Specific versions not specified in CVE description; check Moodle security advisories
Operating Systems: All operating systems running Moodle
Default Config Vulnerable: ✅ No
Notes: Requires misconfigured shared hosting allowing cross-user file access AND user with wiki restore permissions AND direct web server access outside Moodle webroot.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: MEDIUM - Requires both misconfigured hosting and authenticated user with specific permissions.
🏢 Internal Only: MEDIUM - Same requirements apply internally; risk depends on user permissions and server configuration.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

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

linux

Ensure 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

all

Configure 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

🔗 References

📤 Share & Export