CVE-2021-36396

7.5 HIGH

📋 TL;DR

This vulnerability in Moodle allows attackers to bypass cURL security restrictions through insufficient redirect handling, enabling blind Server-Side Request Forgery (SSRF). Attackers can make Moodle send requests to internal systems that should be blocked. All Moodle installations with vulnerable versions are affected.

💻 Affected Systems

Products:
  • Moodle
Versions: 3.9 to 3.9.8, 3.10 to 3.10.5, 3.11 to 3.11.1
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects Moodle installations with cURL enabled (default). The vulnerability bypasses curl.blockedhosts and curl.allowedports settings.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could access internal services, scan internal networks, interact with internal APIs, or exploit other vulnerabilities in internal systems through Moodle's server.

🟠

Likely Case

Information disclosure from internal services, port scanning of internal networks, or interaction with metadata services in cloud environments.

🟢

If Mitigated

Limited impact if proper network segmentation, firewall rules, and cURL restrictions are already in place to block internal access.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires attacker to control a URL that Moodle will fetch, typically through features like URL resource, SCORM packages, or other URL-fetching functionality.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.9.9, 3.10.6, 3.11.2

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

Restart Required: No

Instructions:

1. Backup your Moodle installation and database. 2. Download the patched version from moodle.org. 3. Replace files with patched version. 4. Run the upgrade process through the web interface or CLI.

🔧 Temporary Workarounds

Restrict URL fetching features

all

Disable or restrict features that allow URL fetching by untrusted users

Strengthen network controls

all

Implement strict firewall rules to limit Moodle server's outbound connections

🧯 If You Can't Patch

  • Implement strict network segmentation to limit Moodle server's access to internal systems
  • Review and restrict user permissions for URL-fetching features in Moodle

🔍 How to Verify

Check if Vulnerable:

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

Check Version:

grep \$release /path/to/moodle/version.php | head -1

Verify Fix Applied:

Verify version is 3.9.9+, 3.10.6+, or 3.11.2+ and check that the security fix is listed in the release notes

📡 Detection & Monitoring

Log Indicators:

  • Unusual outbound HTTP requests from Moodle server
  • Multiple failed connection attempts to internal IPs

Network Indicators:

  • Moodle server making unexpected requests to internal services
  • Traffic to blocked hosts or non-standard ports

SIEM Query:

source="moodle_logs" AND (event="url_fetch" OR event="curl_request") AND (dest_ip IN internal_subnets OR dest_port NOT IN allowed_ports)

🔗 References

📤 Share & Export