Stored XSS vulnerability in Moodle

moodle/moodle Updated 02 Oct 2025

Summary

18/06/2024
Yes i
Moderate
6.1

CVE-2024-38274: Moodle stored XSS via calendar's event title when deleting the event. Affects moodle/moodle across 4 version ranges.

< 4.1.11 >= 4.2.0-beta, < 4.2.8 >= 4.3.0-beta, < 4.3.5 >= 4.4.0-beta, < 4.4.1

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2024-38274 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 Penetration testing for web, API and mobile 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 (LMS) used by educational institutions to create and manage online courses. It provides various features such as course management, user management, and collaboration tools. Moodle is written in PHP and relies on a database backend for data storage. The vulnerability in question affects the calendar functionality of Moodle.

Vulnerability Detail

The stored XSS vulnerability in Moodle's calendar arises from insufficient escaping of event titles when deleting an event. This allows an attacker to inject malicious code into the event title, which is not properly sanitized before being displayed in the event deletion prompt. When a user attempts to delete the event, the injected code gets executed in the context of the victim's browser, potentially leading to unauthorized actions or data theft. The severity of this vulnerability is considered moderate, with a CVSS score of 6.1.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 4.1.11 4.1.11
    composer require moodle/moodle:4.1.11
  • >= 4.2.0-beta, < 4.2.8 4.2.8
    composer require moodle/moodle:4.2.8
  • >= 4.3.0-beta, < 4.3.5 4.3.5
    composer require moodle/moodle:4.3.5
  • >= 4.4.0-beta, < 4.4.1 4.4.1
    composer require moodle/moodle:4.4.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, you can disable the calendar functionality in Moodle until the patch is applied. This can be done by modifying the configuration settings or by restricting access to the calendar feature for affected users.

Conclusion

The stored XSS vulnerability in Moodle's calendar poses a moderate risk to the security of the application. It is crucial to apply the provided patches or upgrade to the latest version to mitigate this vulnerability. Additionally, developers should follow secure coding practices and properly sanitize user input to prevent similar vulnerabilities in the future. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for moodle/moodle →

Share this vulnerability

FAQ

Moodle is an open-source learning management system used for creating and managing online courses.

A stored XSS vulnerability allows an attacker to inject malicious code into a web application, which is then stored and executed when accessed by other users.

The stored XSS vulnerability in Moodle's calendar can lead to unauthorized actions, data theft, or the execution of malicious code in the context of a victim's browser.

To fix this vulnerability, you should upgrade to the latest patched version of Moodle and ensure proper input sanitization and escaping in your code.

Yes, you can temporarily disable the calendar functionality in Moodle until the patch is applied.

Related vulnerabilities

Recent vulnerabilities recorded for moodle/moodle.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 4.1.11 4.1.11
    composer require moodle/moodle:4.1.11
  • >= 4.2.0-beta, < 4.2.8 4.2.8
    composer require moodle/moodle:4.2.8
  • >= 4.3.0-beta, < 4.3.5 4.3.5
    composer require moodle/moodle:4.3.5
  • >= 4.4.0-beta, < 4.4.1 4.4.1
    composer require moodle/moodle:4.4.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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