CVE-2026-102577
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Moodle is an open source learning management system written in PHP. Schools, universities, and companies use it to run online courses. IOMAD is a multi-tenant distribution of Moodle that lets one installation serve several companies or organizations; it is built on Moodle core and shares the affected code. Several Moodle features fetch remote URLs on behalf of users, such as the URL downloader repository. To stop these requests from reaching internal systems, administrators maintain a list of blocked hosts and address ranges, and Moodle checks each destination against it with address_in_subnet().
A Server-Side Request Forgery (SSRF) vulnerability (CVE-2026-102577) has been identified in the blocked hosts check used by the URL downloader of Moodle and IOMAD, which allows an authenticated user to bypass blocked host restrictions and make the server send requests to restricted destinations. Moodle tracks this issue as MSA-26-0030 (MDL-88779).
Per MITRE CWE-918: The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
This issue affects all versions of Moodle before 4.5.13, versions 5.0.0 through 5.0.8, versions 5.1.0 through 5.1.5, and versions 5.2.0 through 5.2.1, including End-of-Life release lines such as Moodle 4.3. IOMAD releases built on these Moodle versions contain the same code and are affected as well.
Details
Module Info
- Product: Moodle, IOMAD
- Affected packages:
moodle/moodle(core) - Affected versions: <4.5.13, >=5.0.0 <5.0.9, >=5.1.0 <5.1.6, >=5.2.0 <5.2.2
- GitHub repository: https://github.com/moodle/moodle (Moodle), https://github.com/iomad/iomad (IOMAD)
- Published packages: https://packagist.org/packages/moodle/moodle
- Package manager: Composer
- Fixed in:
- OSS Moodle 4.5.13, 5.0.9, 5.1.6, 5.2.2
- NES for Moodle v4.3.14
- NES for IOMAD v4.3.5
Vulnerability Info
This Medium-severity vulnerability is found in the moodle/moodle package in all versions of Moodle before 4.5.13, versions 5.0.0 through 5.0.8, versions 5.1.0 through 5.1.5, and versions 5.2.0 through 5.2.1, including End-of-Life release lines such as Moodle 4.3. IOMAD releases built on these Moodle versions contain the same code and are affected as well. The CVE record's CNA assigns it a CVSS 3.1 base score of 4.3 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N). Moodle rates it Serious.
address_in_subnet() normalizes the address it is given and compares it with each entry in the subnet list, treating IPv4 and IPv6 entries separately:
function address_in_subnet($addr, $subnetstr, $checkallzeros = false) {
if ($addr == '0.0.0.0' && !$checkallzeros) {
return false;
}
$subnets = explode(',', $subnetstr);
$found = false;
$addr = trim($addr);
$addr = cleanremoteaddr($addr, false); // Normalise.
if ($addr === null) {
return false;
}
$addrparts = explode(':', $addr);
$ipv6 = strpos($addr, ':');An IPv4 address can also be written as an IPv4-mapped IPv6 address. That form refers to the same host, but the function saw it as an IPv6 address and compared it only with IPv6 rules. Blocked ranges written in IPv4 notation, such as the default entries for loopback and private networks, did not match. A URL whose host is given in the mapped form therefore passed the check even though its plain IPv4 form is blocked.
The attacker needs an account that can use a feature which downloads from a user-supplied URL. The request is made by the Moodle server, so it can reach services that are only available from the server's network.
The fix detects an IPv4-mapped IPv6 address and also tests its unwrapped IPv4 form against the subnet list:
$packed = @inet_pton($addr);
if ($packed !== false && strlen($packed) === 16
&& substr($packed, 0, 12) === "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff") {
$unwrapped = inet_ntop(substr($packed, 12));
if ($unwrapped !== false && address_in_subnet($unwrapped, $subnetstr, $checkallzeros)) {
return true;
}
}Mitigation
Moodle publishes security fixes only for its supported release lines. Earlier release lines, including Moodle 4.3 and the IOMAD releases built on it, are End-of-Life and will not receive any public updates to address this issue.
Until the fix is applied, adding the IPv4-mapped IPv6 forms of blocked ranges to the cURL blocked hosts list (Site administration, General, Security, HTTP security) may reduce exposure, since rules written in IPv6 notation are matched against these addresses.
Users of the affected components should apply one of the following mitigations:
- Upgrade to Moodle 4.5.13, 5.0.9, 5.1.6, 5.2.2, or later, or to an IOMAD release built on one of those versions.
- Leverage a commercial support partner like HeroDevs (NES for Moodle, NES for IOMAD) for post-EOL security support.
Credits
- Kaique Costa (finder)
- yusufwib01 (remediation)
- Huong Nguyen (remediation)