CVE-2008-1502: Moodle vulnerable to Cross-site scripting

moodle/moodle Updated 02 Oct 2025

Summary

01/05/2022
Yes i
Moderate
Not published

CVE-2008-1502: Moodle vulnerable to Cross-site scripting. Affects moodle/moodle versions < 1.8.5. Fixed in 1.8.5. How to fix ↓

Also tracked for

The same CVE-2008-1502 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Moodle is an open-source learning management system (LMS) used by educational institutions to create and deliver online courses. It provides a platform for educators to manage and organize course materials, interact with students, and track their progress. Moodle is written in PHP and utilizes various libraries and components to enhance its functionality. However, a vulnerability has been identified in Moodle versions prior to 1.8.5 that allows for cross-site scripting (XSS) attacks. This vulnerability stems from the inadequate HTML filtering performed by the KSES library, which is used by Moodle and other products. Attackers can exploit this flaw by crafting URLs with malicious code, bypassing the HTML filtering and potentially executing arbitrary scripts on the victim's browser.

Vulnerability Detail

The vulnerability in Moodle allows remote attackers to conduct cross-site scripting (XSS) attacks by exploiting the inadequate HTML filtering performed by the KSES library. By crafting URLs with specially crafted protocols, attackers can bypass the HTML filtering and inject malicious scripts into web pages viewed by users. This can lead to various security risks, including the theft of sensitive information, session hijacking, and the spread of malware. The impact of this vulnerability can be significant, as Moodle is widely used in educational institutions and hosts a large amount of sensitive data.

How To Fix

Minimum fixed version

1.8.5

This is the first release that contains the fix.

composer require moodle/moodle:1.8.5

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

Workaround

If upgrading Moodle is not immediately feasible, administrators can implement a temporary workaround to mitigate the risk of XSS attacks. One possible workaround is to modify the KSES library to enhance the HTML filtering capabilities. This can involve updating the library code to include stricter filtering rules or integrating additional security measures. However, it is important to note that modifying the core code of Moodle or its libraries can introduce compatibility issues and may require thorough testing before deployment.

Conclusion

In conclusion, Moodle versions prior to 1.8.5 are vulnerable to cross-site scripting (XSS) attacks due to the inadequate HTML filtering performed by the KSES library. This vulnerability can have significant security implications, including the theft of sensitive information and the spread of malware. It is crucial for administrators to upgrade Moodle to the latest version or apply the recommended workaround to mitigate the risk. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for moodle/moodle →

Share this vulnerability

FAQ

Moodle is an open-source learning management system (LMS) used by educational institutions to create and deliver online courses. It provides a platform for educators to manage and organize course materials, interact with students, and track their progress.

Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by users. This can lead to various security risks, including the theft of sensitive information, session hijacking, and the spread of malware.

The vulnerability in Moodle occurs due to the inadequate HTML filtering performed by the KSES library. Attackers can exploit this flaw by crafting URLs with specially crafted protocols, bypassing the HTML filtering and injecting malicious scripts into web pages viewed by users.

The potential consequences of this vulnerability include the theft of sensitive information, session hijacking, and the spread of malware. As Moodle is widely used in educational institutions and hosts a large amount of sensitive data, the impact of this vulnerability can be significant.

To fix this vulnerability, it is recommended to upgrade Moodle to version 1.8.5 or later. This version includes a fix for the inadequate HTML filtering issue in the KSES library. Upgrading to the latest version of Moodle ensures that the vulnerability is patched and provides a more secure environment for users.

Related vulnerabilities

Recent vulnerabilities recorded for moodle/moodle.

How To Fix

Minimum fixed version

1.8.5

This is the first release that contains the fix.

composer require moodle/moodle:1.8.5

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