CVE-2024-43440
High · 7.5Moodle LFI vulnerability when restoring malformed block backups
CVSS
7.5
EPSS
0.6%
Published
Nov 7, 2024
CISA due date
—
Cloudanix analysis
A problem in Moodle lets attackers read private files on the server by feeding it a specially made backup file during a restore operation.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Application
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Path traversal flaw permits inclusion of arbitrary local files on the server during the restore of specially crafted block backup archives, bypassing intended access restrictions.
Why it matters to the business
Attackers can read sensitive configuration files, credentials, or other data stored on the Moodle server, leading to potential account compromise, data leakage, and compliance violations; the large number of Moodle installations increases overall exposure.
How an attack unfolds
An attacker prepares a malicious block backup archive containing path traversal sequences in file references, uploads it through the backup restore interface, and triggers restoration to force the application to include and expose targeted local files in the resulting page output or logs.
How to fix it
Upgrade Moodle to the version containing commit aea9770cfc7d003a737f4899489d1e3982efe9ac; apply the php5 package update 5.5.9+dfsg-1ubuntu4.13 on affected Ubuntu 14.04 systems; restrict backup restore permissions and validate backup contents before processing.
How to confirm the fix worked
Confirm the installed Moodle codebase contains commit aea9770cfc7d003a737f4899489d1e3982efe9ac; attempt a controlled restore of a non-malicious backup and verify that traversal attempts are rejected; review release notes for the fix.
Typical attack path
- Obtain or create a Moodle account with permission to restore block backups
- Craft a block backup archive embedding path traversal sequences targeting sensitive local files
- Upload and initiate the restore process through the Moodle interface
- Observe or exfiltrate file contents returned during or after restoration
How to detect it
Review web server and Moodle application logs for backup restore events involving unexpected file paths or error messages referencing local file access; examine restored block content for unusual path sequences.
What your security team should do
- Immediately upgrade all Moodle instances to the patched commit
- Audit and restrict user roles permitted to perform block backup restores
- Enable enhanced logging for backup and restore operations
- Scan existing backups and restored content for signs of prior traversal attempts
The record
A flaw was found in moodle. A local file may include risks when restoring block backups.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Packagist | moodle/moodle | 0 | 4.1.12 |
| Packagist | moodle/moodle | 4.2.0-beta | 4.2.9 |
| Packagist | moodle/moodle | 4.3.0-beta | 4.3.6 |
| Packagist | moodle/moodle | 4.4.0-beta | 4.4.2 |
| Bitnami | moodle | 0 | 4.1.12 |
| 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-beta | 4.2.9 |
| packagist | moodle/moodle | 4.3.0-beta | 4.3.6 |
| packagist | moodle/moodle | 4.4.0-beta | 4.4.2 |
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