CVE-2021-20187
PHP vulnerability analysis and mitigation

Overview

CVE-2021-20187 is a security vulnerability discovered in Moodle versions before 3.10.1, 3.9.4, 3.8.7, and 3.5.16. The vulnerability allowed site administrators to execute arbitrary PHP scripts through a PHP include functionality used during Shibboleth authentication (Moodle Advisory).

Technical details

The vulnerability is classified with a CVSS v3.1 base score of 7.2 (HIGH) with the vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H. The issue is related to improper control of code generation (CWE-94) and inclusion of functionality from untrusted control sphere (CWE-829) (NVD).

Impact

If exploited, this vulnerability could allow authenticated site administrators to execute arbitrary PHP code on the server through the Shibboleth authentication mechanism, potentially leading to complete system compromise (Moodle Advisory).

Exploitability

The vulnerability requires high privileges (site administrator access) to exploit, but has low attack complexity and requires no user interaction. There are no known reports of this vulnerability being exploited in the wild (NVD).

Mitigation and workarounds

The vulnerability has been fixed in Moodle versions 3.10.1, 3.9.4, 3.8.7, and 3.5.16. As a workaround, administrators can hardcode preventexecpath to true in config.php, which prevents site administrators from setting some executable paths via the UI (Moodle Advisory).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-54182HIGH8.1
  • PHP logoPHP
  • backpack/crud
NoYesSep 14, 2026
CVE-2026-54178HIGH8.1
  • PHP logoPHP
  • backpack/crud
NoYesSep 14, 2026
CVE-2026-54180HIGH7.6
  • PHP logoPHP
  • backpack/crud
NoYesSep 14, 2026
CVE-2026-57570MEDIUM6.5
  • PHP logoPHP
  • backpack/crud
NoYesSep 14, 2026
CVE-2026-54181MEDIUM5.4
  • PHP logoPHP
  • backpack/crud
NoYesSep 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management