# CVE-2021-20187: Moodle Arbitrary PHP code execution by site admins via Shibboleth configuration

- Severity: High 7.2 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`
- 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): 1.59%, higher than 76% of CVEs (2026-12-02)
- Published: 2021-01-28T18:30:03.000Z
- Modified: 2026-09-08T08:48:14.748Z
- Also known as: GHSA-2jrm-gww7-wch2, BIT-MOODLE-2021-20187
- Weaknesses: CWE-94, CWE-829
- 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 it was possible for site administrators to execute arbitrary PHP scripts via a PHP include used during Shibboleth authentication.

(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.5 before 3.5.16; from 3.8 before 3.8.7; from 3.9 before 3.9.4; from 3.10 before 3.10.1
- moodle moodle: before 3.5.16; from 3.8.0 before 3.8.7; from 3.9.0 before 3.9.4; 3.10.0
- 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 7.2 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.2 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.5 Medium `AV:N/AC:L/Au:S/C:P/I:P/A:P`
- Bitnami Vulnerability Database: rating High

## References

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

## Sources

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

---

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