CVE-2023-28330

6.5 MEDIUM

📋 TL;DR

CVE-2023-28330 is an insufficient input sanitization vulnerability in backup functionality that allows authenticated users with teacher, manager, or admin roles to read arbitrary files from the server. This affects Moodle installations where these privileged users can access backup features, potentially exposing sensitive system files.

💻 Affected Systems

Products:
  • Moodle
Versions: Moodle 4.1.x before 4.1.4, 4.0.x before 4.0.8, 3.11.x before 3.11.14, 3.9.x before 3.9.21
Operating Systems: All platforms running affected Moodle versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects users with teacher, manager, or administrator roles who have access to backup functionality.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Privileged attackers could read sensitive system files like /etc/passwd, configuration files, or database credentials, leading to full system compromise through credential theft or privilege escalation.

🟠

Likely Case

Malicious teachers or admins could access student records, configuration files, or other sensitive application data stored on the server.

🟢

If Mitigated

With proper access controls and monitoring, impact is limited to authorized users who already have significant privileges within the system.

🌐 Internet-Facing: MEDIUM - While exploitation requires authentication, many Moodle instances are internet-facing and have numerous privileged users who could potentially exploit this.
🏢 Internal Only: MEDIUM - Internal privileged users could still exploit this to access sensitive files, though network segmentation provides some protection.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW - Requires authenticated access but exploitation is straightforward once authenticated with appropriate privileges.

Exploitation requires valid credentials with teacher/manager/admin roles and access to backup functionality.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Moodle 4.1.4, 4.0.8, 3.11.14, 3.9.21

Vendor Advisory: https://moodle.org/mod/forum/discuss.php?d=445062

Restart Required: No

Instructions:

1. Backup your Moodle installation and database. 2. Download the patched version from moodle.org. 3. Replace affected files with patched versions. 4. Clear Moodle caches. 5. Verify functionality.

🔧 Temporary Workarounds

Restrict backup access

all

Temporarily disable or restrict access to backup functionality for all users except essential administrators.

Navigate to Site administration > Users > Permissions > Define roles > Edit role capabilities > Search for 'backup' capabilities and set to 'Not set' for teacher/manager roles

Implement file access restrictions

linux

Use web server configuration to restrict file system access to Moodle directories only.

For Apache: Set appropriate Directory restrictions in httpd.conf or .htaccess
For Nginx: Use location blocks to restrict access to sensitive directories

🧯 If You Can't Patch

  • Implement strict access controls and monitoring for backup functionality
  • Regularly audit privileged user accounts and review backup-related logs

🔍 How to Verify

Check if Vulnerable:

Check Moodle version via Site administration > Notifications page or by examining version.php file in Moodle root directory.

Check Version:

grep "\$release" /path/to/moodle/version.php

Verify Fix Applied:

Verify version is 4.1.4, 4.0.8, 3.11.14, or 3.9.21 or later via Site administration > Notifications.

📡 Detection & Monitoring

Log Indicators:

  • Unusual backup operations by privileged users
  • Multiple file access attempts through backup interface
  • Access to non-standard file paths in backup logs

Network Indicators:

  • Unusual patterns of backup-related HTTP requests from privileged accounts

SIEM Query:

source="moodle_logs" AND (event="backup" OR event="restore") AND user_role IN ("teacher","manager","admin") AND file_path NOT LIKE "%/backup/%"

🔗 References

📤 Share & Export