CVE-2014-7836: Moodle multiple cross-site request forgery (CSRF) vulnerabilities
Summary
CVE-2014-7836: Moodle multiple cross-site request forgery (CSRF) vulnerabilities. Affects moodle/moodle across 3 version ranges.
< 2.5.9
>= 2.6.0, < 2.6.6
>= 2.7.0, < 2.7.3
Fixed in 2.5.9, 2.6.6 or 2.7.3, depending on the release line you run. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
Moodle is an open-source learning management system (LMS) used by educational institutions to create and manage online courses. It provides a platform for educators to deliver content, interact with students, and assess their progress. The LTI module in Moodle allows integration with external tools and services. However, versions prior to 2.5.9, 2.6.6, and 2.7.3 are vulnerable to multiple cross-site request forgery (CSRF) attacks.
Vulnerability Detail
The identified vulnerabilities in Moodle's LTI module allow remote attackers to hijack the authentication of arbitrary users. By exploiting these vulnerabilities, an attacker can perform unauthorized actions on behalf of the targeted user. The vulnerabilities exist in the 'mod/lti/request_tool.php' and 'mod/lti/instructor_edit_tool_type.php' endpoints. These endpoints do not properly validate the authenticity of requests, making it possible for an attacker to forge requests and trick users into unknowingly performing malicious actions.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 2.5.92.5.9composer require moodle/moodle:2.5.9 -
>= 2.6.0, < 2.6.62.6.6composer require moodle/moodle:2.6.6 -
>= 2.7.0, < 2.7.32.7.3composer require moodle/moodle:2.7.3
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
If an immediate update is not possible, administrators can implement a workaround by applying custom code changes to the affected endpoints. The code changes should include proper request validation and verification mechanisms to prevent CSRF attacks. Here is an example of how the 'mod/lti/request_tool.php' endpoint can be secured:
// Add the following code at the beginning of the 'request_tool.php' file
// Verify the authenticity of the request
if ($_SERVER['REQUEST_METHOD'] !== 'POST' || empty($_POST['csrf_token']) || $_POST['csrf_token'] !== $_SESSION['csrf_token']) {
// Invalid or missing CSRF token, reject the request
header('HTTP/1.1 403 Forbidden');
exit;
}
// Rest of the original code
// ...
Note: This is a simplified example and may require additional modifications based on the Moodle version and specific implementation.
Conclusion
The identified vulnerabilities in Moodle's LTI module pose a risk of unauthorized actions being performed on behalf of users. It is crucial for administrators to update Moodle to versions 2.5.9, 2.6.6, or 2.7.3, depending on the installed version, to mitigate the risk of CSRF attacks. Additionally, implementing proper request validation and verification mechanisms can provide an interim solution until the update is applied. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for moodle/moodle →
FAQ
Moodle is an open-source learning management system (LMS) used by educational institutions to create and manage online courses. It provides a platform for educators to deliver content, interact with students, and assess their progress.
The LTI (Learning Tools Interoperability) module in Moodle allows integration with external tools and services. It enables educators to incorporate third-party applications and resources into their courses.
Cross-site request forgery (CSRF) vulnerabilities occur when an attacker tricks a user into unknowingly performing actions on a web application without their consent. In the context of Moodle, these vulnerabilities allow an attacker to hijack the authentication of users and perform unauthorized actions on their behalf.
To protect your Moodle installation from CSRF attacks, it is crucial to keep the software up to date with the latest security patches. Additionally, implementing proper request validation and verification mechanisms, such as checking CSRF tokens, can help mitigate the risk of CSRF attacks.
If an immediate update is not possible, administrators can apply custom code changes to the affected endpoints to add request validation and verification mechanisms. However, it is strongly recommended to update Moodle to the patched versions as soon as possible.
References
Related vulnerabilities
Recent vulnerabilities recorded for moodle/moodle.