CVE-2025-62396
📋 TL;DR
An error-handling vulnerability in Moodle's router component (r.php) can expose internal directory listings when specific HTTP headers are misconfigured. This information disclosure affects Moodle installations with improper header configurations, potentially revealing sensitive file structures to attackers.
💻 Affected Systems
- Moodle
📦 What is this software?
Moodle by Moodle
Moodle by Moodle
⚠️ Risk & Real-World Impact
Worst Case
Attackers could map internal directory structures, discover sensitive configuration files, backup files, or source code, leading to further exploitation.
Likely Case
Information disclosure revealing directory structure and potentially sensitive file names, but not file contents.
If Mitigated
Minimal impact with proper HTTP header configurations and directory listing disabled.
🎯 Exploit Status
Exploitation requires specific HTTP header manipulation and misconfiguration
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Check Moodle security advisories for specific patched version
Vendor Advisory: https://moodle.org/security/
Restart Required: No
Instructions:
1. Update Moodle to the latest patched version. 2. Apply security patches from Moodle security advisories. 3. Verify HTTP headers are properly configured.
🔧 Temporary Workarounds
Configure Proper HTTP Headers
allEnsure proper HTTP header configuration to prevent directory listing exposure
Configure web server (Apache/Nginx) to send appropriate headers
Set proper Content-Type and other security headers
Disable Directory Listing
allConfigure web server to disable directory listings
Apache: Options -Indexes in .htaccess or httpd.conf
Nginx: autoindex off; in server configuration
🧯 If You Can't Patch
- Implement strict HTTP header configurations
- Disable directory listings at web server level
- Implement WAF rules to detect directory traversal attempts
🔍 How to Verify
Check if Vulnerable:
Test by accessing r.php with manipulated headers and checking for directory listings
Check Version:
Check Moodle version in Site administration > Notifications or via moodle_version table
Verify Fix Applied:
Verify Moodle version is updated and test that directory listings are no longer exposed
📡 Detection & Monitoring
Log Indicators:
- Multiple requests to r.php with unusual headers
- HTTP 200 responses to directory listing attempts
Network Indicators:
- Unusual HTTP header patterns in requests to r.php
SIEM Query:
web.url:*r.php AND (http.headers:* OR http.status:200 AND response_size:>threshold)