CVE-2021-36399: Moodle - Stored XSS Risk in Quiz Override Screens

moodle Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Medium
Not published

CVE-2021-36399: In Moodle, ID numbers displayed in the quiz override screens required additional sanitizing to prevent a stored XSS risk. Affects moodle versions >= 3.11.0, < 3.11.1. Fixed in 3.11.1. How to fix ↓

Also tracked for

The same CVE-2021-36399 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Moodle is an open-source learning management system used for creating and managing online courses. It provides a wide range of features for educators and learners, including quizzes and assessments. The vulnerability identified as CVE-2021-36399 affects Moodle versions 3.11.0 and is related to the display of ID numbers in the quiz override screens. These ID numbers were not properly sanitized, creating a potential stored cross-site scripting (XSS) risk.

Vulnerability Detail

The vulnerability in Moodle arises from the lack of proper sanitization of ID numbers displayed in the quiz override screens. This allows an attacker to inject malicious code that will be stored and executed when accessed by other users. The impact of this vulnerability can range from unauthorized access to sensitive information to the execution of arbitrary code on the affected Moodle instance. It is important to note that this vulnerability requires an attacker to have low-level privileges within the Moodle system.

How To Fix

Minimum fixed version

3.11.1

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, administrators can manually sanitize the ID numbers displayed in the quiz override screens. This can be achieved by implementing input validation and output encoding techniques to ensure that any user-supplied data is properly sanitized before being displayed to other users. Here is an example of how this can be done in PHP:

$quizId = $_GET['quiz_id'];
$sanitizedQuizId = htmlspecialchars($quizId, ENT_QUOTES, 'UTF-8');
echo $sanitizedQuizId;

By applying this workaround, the risk of stored XSS attacks can be reduced until the Moodle instance is updated to a patched version.

Conclusion

The vulnerability identified as CVE-2021-36399 in Moodle poses a risk of stored cross-site scripting (XSS) in the quiz override screens. It is crucial to update Moodle to a patched version, such as 3.11.1 or later, to mitigate this vulnerability. Administrators can also apply a temporary workaround by manually sanitizing the ID numbers displayed in the quiz override screens. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for moodle →

Share this vulnerability

FAQ

Moodle is an open-source learning management system used for creating and managing online courses. It provides a wide range of features for educators and learners.

Stored cross-site scripting (XSS) is a type of vulnerability that allows an attacker to inject malicious code into a web application, which is then stored and executed when accessed by other users.

The impact of this vulnerability can range from unauthorized access to sensitive information to the execution of arbitrary code on the affected Moodle instance. However, it requires an attacker to have low-level privileges within the Moodle system.

To fix this vulnerability, it is recommended to update Moodle to a version that includes the necessary sanitization of ID numbers in the quiz override screens. Upgrading to a patched version, such as 3.11.1 or later, will mitigate the risk of this vulnerability.

Yes, administrators can manually sanitize the ID numbers displayed in the quiz override screens by implementing input validation and output encoding techniques. This can help reduce the risk of stored XSS attacks until the Moodle instance is updated to a patched version.

Related vulnerabilities

Recent vulnerabilities recorded for moodle.

How To Fix

Minimum fixed version

3.11.1

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback