Miggo Logo

CVE-2025-62398: Moodle does not properly enforce MFA

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.13953%
Published
10/23/2025
Updated
10/24/2025
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
moodle/moodlecomposer>= 5.0.0-beta, < 5.0.35.0.3
moodle/moodlecomposer>= 4.5.0-beta, < 4.5.74.5.7
moodle/moodlecomposer>= 4.4.0-beta, < 4.4.114.4.11

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The analysis of the provided patches indicates that the core of the vulnerability lies within the tool_mfa\manager::should_require_mfa function in public/admin/tool/mfa/classes/manager.php. The security flaw is a result of improper handling of AJAX and Web Service requests during the multi-factor authentication process.

The commit a2078f781ae065ca1f781bd159c7615c84afcaa5 is the primary fix. It removes a conditional check that allowed AJAX and WS requests to proceed without completing MFA if a session was marked as mfa_pending. This created a race condition that could be exploited to bypass MFA. By removing this condition and always returning REDIRECT_EXCEPTION, the patch ensures that these types of requests cannot be used to circumvent MFA.

The commit 67005f8b2098096f4c7ca4f78ab9ce69415d703b refactors the logic within the same function to improve the order of checks. While not the direct fix for the bypass, it contributes to hardening the MFA process by ensuring that various exit conditions (like an admin setup being pending) are checked earlier. This reduces the complexity and potential for other logic errors.

Therefore, the function tool_mfa\manager::should_require_mfa is the key vulnerable function. During an exploit, this function would be called, and its flawed logic would incorrectly grant access, making it the central point of failure and the most critical indicator in a runtime profile.

Vulnerable functions

tool_mfa\manager::should_require_mfa
public/admin/tool/mfa/classes/manager.php
The vulnerability lies in the `should_require_mfa` function. Prior to the patch, the function would allow AJAX and Web Service (WS) requests to bypass MFA if an MFA session was pending (`$SESSION->mfa_pending`). An attacker could initiate an authentication flow, and then send a crafted AJAX/WS request to access resources without completing the MFA step. The patch removes this conditional bypass, ensuring that AJAX/WS requests always trigger a `REDIRECT_EXCEPTION`, thus preventing the bypass.

WAF Protection Rules

WAF Rule

* s*rious *ut**nti**tion *l*w *llow** *tt**k*rs wit* v*li* *r***nti*ls to *yp*ss multi-***tor *ut**nti**tion un**r **rt*in *on*itions, pot*nti*lly *ompromisin* us*r ***ounts.

Reasoning

T** *n*lysis o* t** provi*** p*t***s in*i**t*s t**t t** *or* o* t** vuln*r**ility li*s wit*in t** `tool_m**\m*n***r::s*oul*_r*quir*_m**` *un*tion in `pu*li*/**min/tool/m**/*l*ss*s/m*n***r.p*p`. T** s**urity *l*w is * r*sult o* improp*r **n*lin* o* *J