Cloudanix VulnDB

CVE-2024-43439

Medium · 5.4

Moodle reflected XSS via H5P error message

CVSS

5.4

EPSS

0.4%

Published

Nov 11, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

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

  1. Identify an H5P content endpoint that reflects error messages without sanitization.
  2. Craft a URL embedding a reflected XSS payload targeting the error parameter.
  3. Deliver the link via phishing, shared content, or another vector.
  4. Victim loads the URL, triggering script execution in their authenticated browser session.
  5. 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