CVE-2024-34005
Medium · 6.5CVSS
6.5
EPSS
0.5%
Published
May 31, 2024
CISA due date
—
Cloudanix analysis
A misconfigured shared server could let certain Moodle users read private files belonging to others by abusing a restore feature.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- Application
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Allows a privileged Moodle user with restore permissions and direct filesystem access outside the webroot to perform local file inclusion through path traversal in database activity module restoration under misconfigured shared hosting.
Why it matters to the business
In environments with multiple tenants sharing hosting resources, an attacker with limited Moodle access could read sensitive files from other users, leading to data exposure and potential credential theft without broad network access.
How an attack unfolds
An attacker with a Moodle account that can restore database activity modules and has direct server access outside the Moodle directory crafts a malicious restore payload that traverses paths to include arbitrary local files, bypassing normal webroot restrictions due to the shared hosting misconfiguration.
How to fix it
Upgrade Moodle to the commit e8d03fdae4ec30a40cdc535c8e9e95f30604ec10 or later. Ensure shared hosting environments enforce strict isolation between user directories and restrict direct filesystem access outside the Moodle webroot.
How to confirm the fix worked
Verify the installed Moodle codebase contains commit e8d03fdae4ec30a40cdc535c8e9e95f30604ec10. Audit shared hosting configurations to confirm directory isolation and test that restore operations cannot include files outside the webroot.
Typical attack path
- Obtain a Moodle account with database activity module restore capability
- Gain direct filesystem access to the web server outside the Moodle webroot via the shared hosting misconfiguration
- Prepare a crafted database activity module backup containing a path traversal payload
- Restore the module through the Moodle interface to trigger local file inclusion
- Read the contents of targeted files outside the intended directory
How to detect it
Review Moodle restore logs and web server access logs for restore operations involving database activity modules that reference paths outside the Moodle webroot. Look for file inclusion attempts or reads of unexpected system or user files during restore actions.
What your security team should do
- Apply the fixed commit immediately in all Moodle instances
- Review and harden shared hosting configurations to prevent cross-user directory access
- Restrict the database activity module restore capability to trusted administrators only
- Monitor for unusual restore activity and file access patterns outside the Moodle directory
The record
In a shared hosting environment that has been misconfigured to allow access to other users' content, a Moodle user with both access to restore database activity modules and direct access to the web server outside of the Moodle webroot could execute a local file include.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Packagist | moodle/moodle | 0 | 4.1.10 |
| Packagist | moodle/moodle | 4.2.0 | 4.2.7 |
| Packagist | moodle/moodle | 4.3.0 | 4.3.4 |
| Bitnami | moodle | 0 | 4.1.10 |
| Ubuntu:16.04:LTS | moodle | 0 | No fix |
| Ubuntu:18.04:LTS | moodle | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | moodle | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | moodle | 0 | No fix |
| packagist | moodle/moodle | 4.2.0 | 4.2.7 |
| packagist | moodle/moodle | 4.3.0 | 4.3.4 |
Related vulnerabilities
- GHSA-ggxq-2mg9-8966 Moodle has a Remote Code Execution risk via file restore Also affects moodle/moodle
- GHSA-cg8j-5cr2-568q Moodle TeX formula editor is vulnerable to DoS through lack of execution time limits Also affects moodle/moodle
- CVE-2026-26047 A denial-of-service vulnerability was identified in Moodle’s TeX formula editor. Also affects moodle/moodle
- CVE-2026-26045 A flaw was identified in Moodle’s backup restore functionality where specially crafted… Also affects moodle/moodle
- GHSA-5cx4-w4fh-fr57 Moodle Affected by Improper Restriction of Excessive Authentication Attempts Also affects moodle/moodle
- GHSA-8jrv-wx83-w3xj Moodle Inserts Sensitive Information Into Sent Data Also affects moodle/moodle
- GHSA-hcm6-q6pc-xfhm Moodle has an authorization logic flaw Also affects moodle/moodle
- GHSA-qv78-6gpp-hm68 Moodle Open Redirect vulnerability Also affects moodle/moodle