CVE-2026-102588

Cross-site Request Forgery
Affects
Moodle, IOMAD
in
Moodle
No items found.
Versions
<4.5.13, >=5.0.0 <5.0.9, >=5.1.0 <5.1.6, >=5.2.0 <5.2.2

Patch Available.

Exclamation circle icon
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. The gradebook can import grades from an XML file. With the XML import plugin (gradeimport_xml), a teacher supplies either an uploaded file or the URL of a remote XML file, and Moodle sets or overwrites student grades from its contents.

A Cross-Site Request Forgery (CSRF) vulnerability (CVE-2026-102588) has been identified in the XML grade import of Moodle and IOMAD, which allows a remote attacker to set or overwrite student grades by getting a user with grade import permissions to visit a malicious web page. Moodle tracks this issue as MSA-26-0041 (MDL-84545).

Per MITRE CWE-352: The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.

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

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 6.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N). Moodle rates it Serious.

When a teacher chose to import from a URL, the import form redirected the browser to import.php with the course ID and the URL as request parameters. That script checked the user's login and capabilities, then downloaded the file and imported the grades:

require_login($course);
$context = context_course::instance($id);

require_capability('moodle/grade:import', $context);
require_capability('gradeimport/xml:view', $context);


// Large files are likely to take their time and memory. Let PHP know
// that we'll take longer, and that the process should be recycled soon
// to free up memory.
core_php_time_limit::raise();
raise_memory_limit(MEMORY_EXTRA);

$text = download_file_content($gradesurl);

The script did not require Moodle's session key. Moodle uses that token to confirm that a state-changing request was started from its own pages. Without it, any page a logged-in teacher visits can cause their browser to request import.php with a URL chosen by the attacker. The request carries the teacher's session, so the capability checks pass and the grades in the attacker's XML file are committed to the course.

The victim must be logged in and hold moodle/grade:import and gradeimport/xml:view in the target course, and must be led to a page under the attacker's control. The attacker does not need a Moodle account. The impact is on grade integrity.

The fix makes import.php reachable only through the key-based login path used for scheduled remote imports, and runs interactive imports directly from the session key protected form:

// Only reachable as the body of fetch.php (key login); reject direct access. MDL-84545.
if (!defined('USER_KEY_LOGIN')) {
    throw new \moodle_exception('invalidaccess', 'error');
}

require_capability('moodle/grade:import', $context);
require_capability('gradeimport/xml:view', $context);

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.

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

  • Vincent Schneider (finder, remediation)
  • David Woloszyn (remediation)
Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Medium
ID
CVE-2026-102588
PROJECT Affected
Moodle, IOMAD
Versions Affected
<4.5.13, >=5.0.0 <5.0.9, >=5.1.0 <5.1.6, >=5.2.0 <5.2.2
NES Versions Affected
Published date
September 30, 2026
≈ Fix date
October 12, 2026
Category
Cross-site Request Forgery
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Moodle
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.