The vulnerability allowed users to self-enroll in courses without completing MFA. The provided commit b0965139014b459c3cb96e4fff45af4d5e09e261 directly addresses this.
The primary change is in admin/tool/mfa/classes/manager.php, specifically within the should_require_mfa static method of the tool_mfa\manager class.
The patch removes a condition that checked if the current URL was the enrollment page (/enrol/index.php). If it was, the function would return self::NO_REDIRECT, meaning MFA was not required. By removing this specific block of code, the system now proceeds with the default MFA checks for enrollment pages as well, thus patching the vulnerability.
The corresponding test file admin/tool/mfa/tests/manager_test.php also had related test assertions removed, further confirming that this specific logic in should_require_mfa was responsible for the bypass. Therefore, tool_mfa\manager::should_require_mfa is identified as the vulnerable function because its previous implementation contained the logic that led to the MFA bypass during self-enrollment.