# CVE-2021-27131: Moodle vulnerable to stored Cross-site Scripting

- Severity: Medium 5.4 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.69%, higher than 53% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-05-16T00:00:00.000Z
- Modified: 2026-09-08T08:48:14.524Z
- Also known as: GHSA-w2pm-fr62-jgv4, BIT-MOODLE-2021-27131
- Weaknesses: CWE-79
- Assigned by: mitre

## Description

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).

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- moodle/moodle (Packagist): up to 3.10.1
- moodle moodle: 3.10.1
- moodle (Bitnami): from 3.10.1 before 3.10.2

## Every score

- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/p4nk4jv/CVEs-Assigned/blob/master/Moodle-3.10.1-CVE-2021-27131.md> (exploit, evidence, web)
- <https://github.com/moodle/moodle> (package, product, web)
- <https://docs.moodle.org/402/en/Risks> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-27131> (advisory, web)

## Sources

- CVE List: [CVE-2021-27131](https://www.cve.org/CVERecord?id=CVE-2021-27131), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-w2pm-fr62-jgv4](https://github.com/advisories/GHSA-w2pm-fr62-jgv4), CC-BY-4.0, modified 2024-02-16
- NVD: [CVE-2021-27131](https://nvd.nist.gov/vuln/detail/CVE-2021-27131), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-MOODLE-2021-27131](https://osv.dev/vulnerability/BIT-MOODLE-2021-27131), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-27131 · Whole record: https://cve.day/CVE-2021-27131.json · Rebuilt by cve.day 2026-11-25T22:58:08.455Z
