CVE-2024-34006
Medium · 4.3CVSS
4.3
EPSS
0.4%
Published
May 31, 2024
CISA due date
—
Cloudanix analysis
A problem in how activity logs are shown could let attackers run code in an administrator's browser when they check the reports.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Data Tampering
- Component
- Application
- Class
- XSS
- Remediation
- Patch
- Effort
- Low
- Patch risk
- Low
What it actually does
Insufficient encoding of event descriptions in the site log report allows arbitrary HTML and JavaScript to render and execute in the viewing user's browser instead of displaying as plaintext.
Why it matters to the business
Administrators reviewing activity logs could be exposed to client-side code execution that alters page content or triggers unwanted actions, potentially leading to session misuse or phishing success within the application.
How an attack unfolds
An attacker triggers a logged event containing crafted HTML or script in the description field; when an administrator later views the site log report, the browser renders and executes the injected content due to missing output encoding.
How to fix it
Upgrade Moodle to the version containing commit e8d03fdae4ec30a40cdc535c8e9e95f30604ec10 or later; apply the patch that adds proper encoding to event descriptions in the log report output.
How to confirm the fix worked
Confirm the installed version includes commit e8d03fdae4ec30a40cdc535c8e9e95f30604ec10; test by injecting HTML into an event description and verifying it appears as escaped text rather than rendered markup in the log report.
Typical attack path
- Attacker performs an action that generates a log entry with malicious HTML in the event description
- Attacker waits for or lures an administrator to access the site log report page
- Browser renders the unencoded content, executing the injected script in the administrator's session context
How to detect it
Inspect web server access logs and application logs for repeated or unusual accesses to the site log report page shortly after events that could contain user-controlled data; look for requests containing suspicious encoded HTML patterns in parameters that feed event descriptions.
What your security team should do
- Apply the fixed commit or upgrade Moodle immediately across all instances
- Review administrative access controls to the site log report to limit exposure
- Monitor web application firewall rules for anomalous requests targeting log report endpoints
The record
The site log report required additional encoding of event descriptions to ensure any HTML in the content is displayed in plaintext instead of being rendered.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Packagist | moodle/moodle | 0 | 4.1.10 |
| Packagist | moodle/moodle | 4.2.0 | 4.2.7 |
| Packagist | moodle/moodle | 4.3.0 | 4.3.4 |
| Bitnami | moodle | 0 | 4.1.10 |
| 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 | 4.2.7 |
| packagist | moodle/moodle | 4.3.0 | 4.3.4 |
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