CVE-2026-133072
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 Quiz activity (mod_quiz) groups its questions into sections, each with a heading and a shuffle setting. The quiz editing page changes sections and slots through background requests to mod/quiz/edit_rest.php.
An Authorization Bypass vulnerability (CVE-2026-133072) has been identified in the quiz editing functionality of Moodle and IOMAD, which allows a teacher who can manage one quiz to rename, reshuffle or remove sections of other quizzes and to read slot details from them. Moodle tracks this issue as MSA-26-0059 (MDL-89475).
Per MITRE CWE-639: The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
This issue affects all versions of Moodle before 4.5.16, versions 5.0.0 through 5.1.8, versions 5.2.0 through 5.2.4, and version 5.3.0, including End-of-Life release lines such as Moodle 4.3 and 5.0. 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 (mod_quiz)
- Affected versions: <4.5.16, >=5.0.0 <5.1.9, >=5.2.0 <5.2.5, >=5.3.0 <5.3.1
- 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.16, 5.1.9, 5.2.5, 5.3.1
- NES for Moodle v4.3.16
- NES for IOMAD v4.3.7
Vulnerability Info
This Medium-severity vulnerability is found in the moodle/moodle package in all versions of Moodle before 4.5.16, versions 5.0.0 through 5.1.8, versions 5.2.0 through 5.2.4, and version 5.3.0, including End-of-Life release lines such as Moodle 4.3 and 5.0. 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 5.4 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N). Moodle rates it Serious.
The editing endpoint checks that the caller can manage the quiz named in the request, then passes the section or slot ID from the request to the quiz structure class. The section methods loaded the record by ID only:
public function remove_section_heading($sectionid) {
global $DB;
$section = $DB->get_record('quiz_sections', ['id' => $sectionid], '*', MUST_EXIST);
if ($section->firstslot == 1) {
throw new \coding_exception('Cannot remove the first section in a quiz.');
}
$DB->delete_records('quiz_sections', ['id' => $sectionid]);The same pattern was used when changing a section heading or shuffle setting, and when reading the maximum mark of a slot in edit_rest.php. Because the record was never matched against the quiz that passed the capability check, a user with mod/quiz:manage on one quiz could supply the ID of a section or slot from any other quiz on the site. They could then change or delete that section, or read the slot's maximum mark.
The caller needs mod/quiz:manage on at least one quiz. The issue does not expose question content or student attempts.
The fix adds the quiz ID to each lookup and to the delete, so a section or slot from another quiz is no longer found:
public function remove_section_heading($sectionid) {
global $DB;
$section = $DB->get_record('quiz_sections', ['id' => $sectionid, 'quizid' => $this->get_quizid()], '*', MUST_EXIST);
if ($section->firstslot == 1) {
throw new coding_exception('Cannot remove the first section in a quiz.');
}
$DB->delete_records('quiz_sections', ['id' => $sectionid, 'quizid' => $this->get_quizid()]);Mitigation
Moodle publishes security fixes only for its supported release lines. Moodle 5.0 and the release lines before 4.5, 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.16, 5.1.9, 5.2.5, 5.3.1, 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)