# CVE-2021-20186: Moodle 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.76%, higher than 56% of CVEs (2026-12-02)
- Published: 2021-01-28T18:38:03.000Z
- Modified: 2026-09-08T08:48:14.534Z
- Also known as: GHSA-h8m4-h385-qhqv, BIT-MOODLE-2021-20186
- Weaknesses: CWE-79
- Assigned by: redhat

## Description

It was found in Moodle before version 3.10.1, 3.9.4, 3.8.7 and 3.5.16 that if the TeX notation filter was enabled, additional sanitizing of TeX content was required to prevent the risk of stored XSS.

(As written by CVE List.)

## Affected

- moodle: moodle 3.10.1, moodle 3.9.4, moodle 3.8.7, moodle 3.5.16
- moodle/moodle (Packagist): from 3.10 before 3.10.1; from 3.9 before 3.9.4; from 3.8 before 3.8.7; from 3.5 before 3.5.16
- moodle moodle: before 3.5.16; from 3.8.0 before 3.8.7; from 3.9.0 before 3.9.4; from 3.10.0 before 3.10.1
- moodle (Bitnami): before 3.5.16; from 3.8.0 before 3.8.7; from 3.9.0 before 3.9.4; from 3.10.0 before 3.10.1

## 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`
- NVD: CVSS:2.0 2.1 Low `AV:N/AC:H/Au:S/C:P/I:N/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://moodle.org/mod/forum/discuss.php?d=417170> (advisory, patch, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-20186> (advisory, web)
- <https://github.com/moodle/moodle> (package)

## Sources

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

---

Page: https://cve.day/CVE-2021-20186 · Whole record: https://cve.day/CVE-2021-20186.json · Rebuilt by cve.day 2026-11-25T22:57:59.749Z
