CVE-2021-32474

7.2 HIGH

📋 TL;DR

This SQL injection vulnerability in Moodle allows attackers to execute arbitrary SQL commands via XML-RPC calls when MNet (Moodle Network) is enabled and configured. It requires either site administrator access or access to the keypair for exploitation. Moodle versions 3.5 through 3.10.3 are affected.

💻 Affected Systems

Products:
  • Moodle
Versions: 3.5 to 3.5.17, 3.8 to 3.8.8, 3.9 to 3.9.6, 3.10 to 3.10.3
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Requires MNet to be enabled and configured, and attacker needs admin access or keypair access

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, privilege escalation, or data destruction

🟠

Likely Case

Unauthorized data access and potential privilege escalation within the Moodle application

🟢

If Mitigated

Limited impact due to proper access controls and network segmentation

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires specific conditions: MNet enabled and attacker has admin access or keypair

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.10.4, 3.9.7, 3.8.9, 3.5.18

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

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.

🔧 Temporary Workarounds

Disable MNet

all

Disable Moodle Network functionality if not required

Navigate to Site administration > Plugins > Authentication > Manage authentication > Disable MNet authentication

Restrict XML-RPC Access

all

Limit XML-RPC access to trusted IPs only

Configure web server (Apache/Nginx) to restrict access to XML-RPC endpoints

🧯 If You Can't Patch

  • Disable MNet functionality entirely if not required
  • Implement strict network segmentation and firewall rules to limit XML-RPC access

🔍 How to Verify

Check if Vulnerable:

Check Moodle version and verify MNet is enabled in Site administration > Plugins > Authentication

Check Version:

Check version in Moodle Site administration > General > Notifications or via CLI: php admin/cli/version.php

Verify Fix Applied:

Verify Moodle version is patched (3.10.4+, 3.9.7+, 3.8.9+, or 3.5.18+)

📡 Detection & Monitoring

Log Indicators:

  • Unusual XML-RPC requests
  • SQL error messages in logs
  • Unexpected database queries

Network Indicators:

  • XML-RPC traffic to Moodle servers from unauthorized sources

SIEM Query:

source="moodle_logs" AND ("XML-RPC" OR "SQL error")

🔗 References

📤 Share & Export