CVE-2024-43439
Medium · 5.4Moodle reflected XSS via H5P error message
CVSS
5.4
EPSS
0.4%
Published
Nov 11, 2024
CISA due date
—
Cloudanix analysis
A bug in the learning platform lets attackers trick users into running harmful code in their browsers by sending specially crafted links.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Application
- Class
- XSS
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Insufficient sanitization of H5P error messages allows injection of arbitrary JavaScript that executes in the victim's browser when the crafted error page is rendered.
Why it matters to the business
Attackers can hijack user sessions, steal credentials, or perform unauthorized actions inside the learning platform, leading to data exposure and loss of trust in educational systems.
How an attack unfolds
An attacker crafts a malicious URL containing a script payload in an H5P error parameter, tricks a user into visiting it, and the unsanitized error message executes the script in the user's session context.
How to fix it
Upgrade Moodle to the version containing commit aea9770cfc7d003a737f4899489d1e3982efe9ac. For Red Hat systems running the listed Grafana packages, update to grafana-7.5.11-4.el8_6 or later.
How to confirm the fix worked
Confirm the presence of commit aea9770cfc7d003a737f4899489d1e3982efe9ac in the codebase, re-test H5P error paths with known XSS vectors to verify sanitization, and review release notes for the applied fix.
Typical attack path
- Identify an H5P content endpoint that reflects error messages without sanitization.
- Craft a URL embedding a reflected XSS payload targeting the error parameter.
- Deliver the link via phishing, shared content, or another vector.
- Victim loads the URL, triggering script execution in their authenticated browser session.
- Script performs actions such as cookie theft, form submission, or account takeover.
How to detect it
Review web server access logs for requests to H5P endpoints containing suspicious script tags or encoded JavaScript in error parameters; inspect application logs for unexpected error message rendering.
- H5P error parameter containing script, onerror, or javascript: patterns
- Access logs showing reflected error URLs with encoded < or > characters
What your security team should do
- Apply the listed fixed versions immediately due to the public disclosure date and XSS impact.
- Scan all Moodle instances for the vulnerable H5P error handling code.
- Implement web application firewall rules to block common reflected XSS patterns in H5P endpoints.
- Educate content authors on safe H5P usage and monitor for unusual error message activity.
The record
A flaw was found in moodle. H5P error messages require additional sanitizing to prevent a reflected cross-site scripting (XSS) risk.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Packagist | moodle/moodle | 0 | 4.1.12 |
| Packagist | moodle/moodle | 4.2.0-beta | 4.2.9 |
| Packagist | moodle/moodle | 4.3.0-beta | 4.3.6 |
| Packagist | moodle/moodle | 4.4.0-beta | 4.4.2 |
| Bitnami | moodle | 0 | 4.1.12 |
| Ubuntu:16.04:LTS | moodle | 0 | No fix |
| Ubuntu:18.04:LTS | moodle | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | moodle | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | moodle | 0 | No fix |
| packagist | moodle/moodle | 4.2.0-beta | 4.2.9 |
| packagist | moodle/moodle | 4.3.0-beta | 4.3.6 |
| packagist | moodle/moodle | 4.4.0-beta | 4.4.2 |
Related vulnerabilities
- GHSA-ggxq-2mg9-8966 Moodle has a Remote Code Execution risk via file restore Also affects moodle/moodle
- GHSA-cg8j-5cr2-568q Moodle TeX formula editor is vulnerable to DoS through lack of execution time limits Also affects moodle/moodle
- CVE-2026-26047 A denial-of-service vulnerability was identified in Moodle’s TeX formula editor. Also affects moodle/moodle
- CVE-2026-26045 A flaw was identified in Moodle’s backup restore functionality where specially crafted… Also affects moodle/moodle
- GHSA-5cx4-w4fh-fr57 Moodle Affected by Improper Restriction of Excessive Authentication Attempts Also affects moodle/moodle
- GHSA-8jrv-wx83-w3xj Moodle Inserts Sensitive Information Into Sent Data Also affects moodle/moodle
- GHSA-hcm6-q6pc-xfhm Moodle has an authorization logic flaw Also affects moodle/moodle
- GHSA-qv78-6gpp-hm68 Moodle Open Redirect vulnerability Also affects moodle/moodle