CVE-2021-27131Moodle
Medium 5.4
Follow: this CVE · Moodle · Moodle We alert you by email or Slack (account required).
- Priority
- 32
- CVSS 3.1
- 5.4
- EPSS
- 0.7% probability of exploitation in 30 days · percentile 54
- Auth required
- Yes
- Published
- May 16, 2023
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-79
- Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
What happens
Moodle 3.10.1 is vulnerable to persistent/stored cross-site scripting (XSS) due to the improper input sanitization on the "Additional HTML Section" via "Header and Footer" parameter in /admin/settings.php. This vulnerability is leading an attacker to steal admin and all user account cookies by storing the malicious XSS payload in Header and Footer. NOTE: this is disputed by the vendor because the "Additional HTML Section" for "Header and Footer" can only be supplied by an administrator, who is intentionally allowed to enter unsanitized input (e.g., site-specific JavaScript).
What to do
- Apply the vendor's security update for Moodle.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Packagist | moodle/moodle |
≤ 3.10.1 |
no fixed version | — |
Per OSV / GitHub Advisories (GHSA-w2pm-fr62-jgv4). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| moodle | moodle | 3.10.1 |
Official sources
References
Links published by the sources. Open them with care.
- docs.moodle.org
- github.com Product
- github.com Exploit