CVE-2024-34005
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedIn 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · moderate confidenceThis is a local file include vulnerability in Moodle that requires a specific combination of conditions: a misconfigured shared hosting environment allowing cross-user file access, combined with a user who has restore database activity module permissions and direct access to the web server filesystem outside the Moodle webroot.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data< 4.1.10>= 4.2.0, < 4.2.7>= 4.3.0, < 4.3.4CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Check Moodle versionLocate the version.php file in the Moodle root directory (usually /lib/version.php or check the version number displayed in the site administration under Notifications). Alternatively, access /admin/registry.php or check the version string in the Moodle admin interface.Affected if The installed version is less than 4.1.10, OR between 4.2.0 and 4.2.6 inclusive, OR between 4.3.0 and 4.3.3 inclusive.
-
Identify hosting environment typeReview the server configuration to determine if this is a shared hosting setup. Check if multiple Moodle installations share the same web server document root or if the data directory (/moodledata) is accessible across different user accounts. Look for the $CFG->dataroot setting in config.php and verify file permissions and ownership.Affected if The server is a shared hosting environment where the Moodle data directory or webroot allows cross-user file access (multiple user accounts can read/write to each other's Moodle files).
-
Verify database restore permissionsIn Moodle admin, go to Site Administration > Users > Permissions > Define Roles and check if any roles (particularly custom roles) have the 'moodle/restore:restoreactivity' or 'moodle/restore:restoredatabase' capability assigned. Also check Site Administration > Users > Assign system roles to see which users have been granted restore-related roles.Affected if Any user account (other than admin) has been assigned roles with the capability to restore database activities or has explicit restore database permissions.
-
Check filesystem access outside webrootExamine the web server configuration (Apache/Nginx) and the Moodle config.php file. Determine if the web server process user can access directories outside the Moodle webroot ($CFG->dirroot). Test by attempting to access files from /etc/passwd or other system files through any file inclusion functionality if accessible.Affected if The web server runs with permissions that allow reading files from directories outside the Moodle webroot, and the server configuration does not restrict PHP scripts to the webroot scope.
A user is affected if their Moodle version falls within the vulnerable ranges AND they operate in a shared hosting environment with cross-user file access AND a user with restore database permissions exists AND the web server can access files outside the Moodle webroot.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped4.1.104.2.74.3.4
Primary remediation involves fixing the shared hosting configuration to properly isolate user content and prevent access to other users' files. Additionally, review and restrict Moodle user permissions for the database restore functionality.
Upgrade to Moodle 4.1.10, 4.2.7, or 4.3.4 depending on your current branch
- 1. Identify the current Moodle version by checking the admin interface or version.php file
- 2. Based on the current version branch, determine the target upgrade version: for 4.1.x upgrade to 4.1.10, for 4.2.x upgrade to 4.2.7, for 4.3.x upgrade to 4.3.4
- 3. Before upgrading, take a complete backup of the Moodle database, moodledata directory, and code files
- 4. Review the Moodle upgrade documentation for your specific upgrade path
- 5. Place the site into maintenance mode via Site Administration > Server > Maintenance Mode
- 6. Replace the Moodle code files with the new version, preserving config.php and any local customizations
- 7. Run the upgrade process by accessing the site URL, which will automatically trigger the database upgrade
- 8. Clear all caches via Site Administration > Development > Purge caches
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation4.0 h
- Testing2.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,168.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2024-34005 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2024-34005 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data