CVE-2021-40693: Moodle type juggling vulnerability
6.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.24573%
CWE
Published
9/30/2022
Updated
4/23/2024
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| moodle/moodle | composer | >= 3.9, < 3.9.10 | 3.9.10 |
| moodle/moodle | composer | >= 3.10, < 3.10.7 | 3.10.7 |
| moodle/moodle | composer | >= 3.11, < 3.11.3 | 3.11.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper type handling during external database authentication. PHP's type juggling in comparisons can cause '0e1234' (hash) == 0 (integer input) to evaluate as true. The auth/db/auth.php's user_login method would be responsible for fetching and comparing external DB credentials, making it the most likely location for this vulnerability. While direct commit references aren't available, the CWE-287 context and Moodle's authentication architecture strongly support this conclusion.