Every CVE Search/ Get API key

CVE-2021-20186

Moodle Cross-site Scripting

5.4 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
Low
User interaction
Required

What an attacker can affect

Confidentiality
Low
Integrity
Low
Availability
None

Exploit likelihood

0.76%Up 0.3 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 5.4

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.

Record
CVE-2021-20186
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
CVSS 2.0
2.1 LowAV:N/AC:H/Au:S/C:P/I:N/A:N
Weakness
CWE-79
Updated
2026-11-02
CVE List No score

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.

Record
CVE-2021-20186
Weakness
CWE-79
Updated
2026-11-02
EUVDEUVD-2022-4109 No score

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.

Record
EUVD-2022-4109
Updated
2026-11-03
GitHub AdvisoriesGHSA-h8m4-h385-qhqv 5.4

Moodle Cross-site Scripting

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.

Record
GHSA-h8m4-h385-qhqv
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Weakness
CWE-79
Updated
2026-11-02
OSV 5.4

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.

Record
CVE-2021-20186
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Updated
2026-11-02
OSVGHSA-h8m4-h385-qhqv 5.4

Moodle Cross-site Scripting

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.

Record
GHSA-h8m4-h385-qhqv
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Weakness
CWE-79
Updated
2026-11-02
OSVUBUNTU-CVE-2021-20186 5.4

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.

Record
UBUNTU-CVE-2021-20186
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Updated
2026-11-02
OSVBIT-moodle-2021-20186 No score

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.

Record
BIT-moodle-2021-20186
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
moodle/moodle
Packagist
3.10 up to 3.10.1
3.10.1
moodle/moodle
Packagist
3.9 up to 3.9.4
3.9.4
moodle/moodle
Packagist
3.8 up to 3.8.7
3.8.7
moodle/moodle
Packagist
3.5 up to 3.5.16
3.5.16
moodle
Bitnami
before 3.5.16, 3.8.0 up to 3.8.7, 3.9.0 up to 3.9.4, 3.10.0 up to 3.10.1
3.5.163.8.73.9.43.10.1
moodle/moodle
Packagist
3.10 up to 3.10.1, plus listed versions
v3.10.0v3.10.0-betav3.10.0-rc1v3.10.0-rc2
3.10.1
moodle/moodle
Packagist
3.9 up to 3.9.4, plus listed versions
v3.9.0v3.9.0-betav3.9.0-rc1v3.9.0-rc2v3.9.0-rc3v3.9.1v3.9.2v3.9.3
3.9.4
moodle/moodle
Packagist
3.8 up to 3.8.7, plus listed versions
v3.8.0v3.8.0-betav3.8.0-rc1v3.8.1v3.8.2
Show 4 moreShow less
v3.8.3v3.8.4v3.8.5v3.8.6
3.8.7
moodle/moodle
Packagist
3.5 up to 3.5.16, plus listed versions
v3.5.0v3.5.0-betav3.5.0-rc1v3.5.1v3.5.10
Show 13 moreShow less
v3.5.11v3.5.12v3.5.13v3.5.14v3.5.15v3.5.2v3.5.3v3.5.4v3.5.5v3.5.6v3.5.7v3.5.8v3.5.9
3.5.16
moodle
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
2.7.9+dfsg-12.7.10+dfsg-12.7.11+dfsg-12.7.11+dfsg-22.7.12+dfsg-13.0.3+dfsg-0ubuntu13.0.3+dfsg-0ubuntu1+esm1
None known
moodle
Ubuntu:Pro:18.04:LTS
All versions, plus listed versions
3.0.3+dfsg-0ubuntu13.0.3+dfsg-0ubuntu1+esm1
None known

History

History
RecordedChangedSources
facts
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-20186 is a medium vulnerability (CVSS 5.4) in Moodle, published January 28, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.76%, the 55th percentile. Fixed in moodle/moodle 3.10.1.

References

MoveEnter Open