CVE-2021-27131
PHP vulnerability analysis and mitigation

Overview

Moodle 3.10.1 was reported to have a persistent/stored cross-site scripting (XSS) vulnerability in the 'Additional HTML Section' via the 'Header and Footer' parameter in /admin/settings.php. This vulnerability was disclosed on May 16, 2023. However, this vulnerability 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 like site-specific JavaScript (NVD).

Technical details

The vulnerability was reported to allow injection of malicious JavaScript code into the 'Header' and 'Footer' fields of the Additional HTML section. When exploited, the malicious payload would execute on all pages of the application. The vulnerability has a CVSS v3.1 Base Score of 5.4 (MEDIUM) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N (NVD).

Impact

The reported impact would allow an attacker to steal admin and all user account cookies by storing malicious XSS payload in the Header and Footer sections. However, since this functionality is restricted to administrators who are intentionally given the ability to add custom JavaScript, the actual security impact is disputed (NVD).

Mitigation and workarounds

Since this is a disputed vulnerability where the behavior is by design - administrators are intentionally allowed to add custom JavaScript - no specific mitigation is required. Organizations should ensure that only trusted administrators have access to modify the Additional HTML sections (Moodle Risks).

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-2025-65346CRITICAL9.1
  • PHPPHP
  • alexusmai/laravel-file-manager
NoNoDec 04, 2025
CVE-2025-66468HIGH7.6
  • PHPPHP
  • aimeos/ai-cms-grapesjs
NoYesDec 02, 2025
CVE-2025-65345MEDIUM6.5
  • PHPPHP
  • alexusmai/laravel-file-manager
NoNoDec 03, 2025
CVE-2025-65657MEDIUM6.5
  • PHPPHP
  • feehi/cms
NoNoDec 02, 2025
CVE-2025-65186MEDIUM6.1
  • PHPPHP
  • getgrav/grav
NoNoDec 02, 2025

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