CVE-2026-102578

SQL Injection
Affects
Moodle, IOMAD
in
Moodle
No items found.
Versions
>=4.0.0 <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 question bank keeps every version of a question. The question history plugin (qbank_history) lists the versions of one question bank entry, and the list can be loaded through a question bank web service that accepts view parameters from the client.

A SQL Injection vulnerability (CVE-2026-102578) has been identified in the question bank history view of Moodle and IOMAD, which allows an authenticated user with access to the question bank web service to inject SQL into a Moodle database query. Moodle tracks this issue as MSA-26-0031 (MDL-89383).

Per MITRE CWE-89: The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.

This issue affects Moodle versions 4.0.0 through 4.5.12, 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 Moodle versions 4.0.0 through 4.5.12, 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 5.5 (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:N). Moodle rates it Serious.

The history view receives the ID of the question bank entry in its extra parameters and stores it as given. When the view builds its query, the stored value is placed directly into the WHERE clause:

// Build the where clause.
$entryid = "qbe.id = $this->entryid";
// Changes done here to get the questions only for the passed entryid.
$tests = ['q.parent = 0', $entryid];

The entry ID is expected to be an integer but was never cleaned or bound as a parameter. When the parameters arrive through the web service, the caller controls the value, and any SQL in it becomes part of the statement. The CVE record states that this could allow an attacker to view, alter or delete data in the underlying database.

The caller needs access to the question bank, which typically means a teacher role or higher. The CVE record's score reflects a high privilege requirement.

The fix cleans the value as an integer when the view is constructed and binds it as a named query parameter:

// Build the where clause.
// Changes done here to get the questions only for the passed entryid.
$tests = ['q.parent = 0', 'qbe.id = :entryid'];
$this->sqlparams = [];

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

  • Caveeroo (finder)
  • A K M Safat Shahin (remediation)
Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Medium
ID
CVE-2026-102578
PROJECT Affected
Moodle, IOMAD
Versions Affected
>=4.0.0 <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
SQL Injection
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.