Vulnerability record · CVE-2021-36393 · published 6 March 2023
CVE-2021-36393: Moodle SQL injection in recent courses library
Moodle · Moodle
Moodle contains a SQL injection flaw in the library that fetches a user's recent courses. Because the injection point is reachable over the network without authentication, it exposes the database to direct manipulation. The record gives no affected version range, so defenders must confirm their release against the vendor advisory.
Description
In Moodle, an SQL injection risk was identified in the library fetching a user's recent courses.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Automated analysis
critical priorityCVSS 9.8 with no authentication or user interaction required, and a very high EPSS score, make this an urgent patch target despite the absence of KEV listing.
What it is
Moodle contains a SQL injection flaw in the library that fetches a user's recent courses. Because the injection point is reachable over the network without authentication, it exposes the database to direct manipulation. The record gives no affected version range, so defenders must confirm their release against the vendor advisory.
Impact
An unauthenticated attacker can inject SQL into queries run by the recent-courses library, potentially reading, altering, or deleting data in the Moodle database and, depending on database privileges, executing further database-level actions.
Attack surface
Reached over the network via the vulnerable recent-courses code path; the CVSS vector shows no privileges and no user interaction required, so no authentication is needed.
Exploitation
Not listed in CISA KEV and no public exploit reference is tagged, but EPSS is 0.523 (98.9th percentile), indicating a high modeled likelihood of exploitation activity.
What to do
- Apply the vendor patch referenced in the Moodle advisory (forum discussion 424798) as the first action.
- If immediate patching is not possible, restrict network access to the affected Moodle endpoints to trusted users or networks.
- Review database account privileges used by Moodle and remove unnecessary write or administrative rights.
- Audit and monitor Moodle logs for anomalous requests to recent-course functionality until patched.
Detection
- Search web and application logs for unusual or malformed requests to recent-course endpoints.
- Enable and review database query logging for injected SQL patterns originating from Moodle application accounts.
- Alert on unexpected schema changes, bulk data reads, or errors from the Moodle database user.
- Correlate Moodle access logs with database activity to spot injection attempts.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
| Link | Tags |
|---|---|
| https://moodle.org/mod/forum/discuss.php?d=424798 | PatchVendor Advisory |
| https://moodle.org/mod/forum/discuss.php?d=424798 | PatchVendor Advisory |
Track CVE-2021-36393 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2021-36393), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.