CVE-2021-27131
MEDIUM 5.4CVSS 3.1Moodle vulnerable to stored Cross-site Scripting
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).
- Published
- 16 May 2023
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- BIT-moodle-2021-27131GHSA-w2pm-fr62-jgv4
- Sources
- NVDJSONOSV GHSA-w2pm-fr62-jgv4JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | moodle | moodlecpe:2.3:a:moodle:moodle:3.10.1:*:*:*:*:*:*:* |
= 3.10.1 | |
| OSV | Packagist | moodle/moodle | <= 3.10.1 |
References
- https://docs.moodle.org/402/en/Risks · WEB
- https://github.com/moodle/moodle · Product, PACKAGE
- https://github.com/p4nk4jv/CVEs-Assigned/blob/master/Moodle-3.10.1-CVE-2021-27131.md · Exploit, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-27131 · ADVISORY
History
- 25 Nov 2026 20:36 UTC · NVD: first stored (published 16 May 2023)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 16 May 2023)