Appsecure logo

CVE-2021-27131: Medium Vulnerability in Moodle

Moodle 3.10.1 is impacted by a medium-severity persistent XSS vulnerability. Attackers could exploit this flaw to steal admin cookies. Immediate patching is recommended.

MEDIUMCVSS 5.4 · Published May 16, 2023

Not a customer? See how AppSecure simulates real world attacks to protect your infrastructure.

Speak to Experts

Moodle version 3.10.1 is vulnerable to a persistent/stored cross-site scripting (XSS) vulnerability caused by improper input sanitization in the "Additional HTML Section" through the "Header and Footer" parameter located in /admin/settings.php. This vulnerability allows an attacker to store a malicious XSS payload in the Header and Footer, potentially leading to the theft of admin and user account cookies. It is important to note that the vendor disputes this vulnerability, stating that the "Additional HTML Section" can only be supplied by an administrator who is permitted to enter unsanitized input, such as site-specific JavaScript.

The severity of this vulnerability is classified as medium, with a CVSS score of 5.4. This score indicates that while the attack vector is network-based and requires low complexity, it does necessitate user interaction. The potential impact on confidentiality and integrity is low, while there is no impact on availability.

Risk to organizations includes the potential for attackers to exploit this vulnerability to gain unauthorized access to sensitive user information. Organizations using Moodle 3.10.1 should prioritize patching this vulnerability to mitigate risks associated with unauthorized access to user accounts.

Given the current status of the exploitation, there are no known public exploits, and this vulnerability is not included in the Known Exploited Vulnerabilities (KEV) catalog. Thus, organizations should assess their vulnerability management strategies and schedule remediation as part of their priority patch cycle.

Organizations should prioritize patching immediately.

Vulnerability Details

The affected product is Moodle version 3.10.1. This vulnerability allows attackers to exploit improper input sanitization leading to persistent XSS, classified under CWE-79.

Technical Analysis

The root cause of this vulnerability is the lack of adequate input sanitization on user-input fields. Attackers can leverage this flaw through a network attack vector, requiring low complexity and low privileges while needing user interaction to execute the payload. The potential impacts are low for confidentiality and integrity, with no impact on availability.

Risk & Impact Analysis

Real-world risk involves the potential for attackers to exploit this vulnerability to access sensitive data through stolen cookies. The urgency for addressing this vulnerability is medium, as the overall impact is moderate. Organizations should evaluate their exposure to this vulnerability and consider the potential blast radius if exploited.

Exploitation Status

Signal

Status

Known Exploit

No

Public PoC

No

Actively Exploited

No

Ransomware Use

No

Affected Versions

The affected version is Moodle 3.10.1. Organizations running this version should take immediate action to update to the latest version to mitigate risks associated with this vulnerability.

Mitigation & Remediation

To remediate this vulnerability, organizations should upgrade to the latest version of Moodle as soon as possible. For those unable to upgrade immediately, consider implementing input validation and output encoding for the affected fields. Additionally, enhancing monitoring of user input and applying web application firewall rules can help mitigate potential exploits.

Organizations should validate remediation through penetration testing to ensure robustness against XSS vulnerabilities.

Detection Guidance

Organizations should monitor for unusual logins, especially from administrative accounts, and review logs for any unauthorized JavaScript execution. Anomalies in user behavior patterns can also indicate potential exploitation attempts.

AppSecure Threat Intelligence Insight

The long-term significance of CVE-2021-27131 lies in the ongoing challenge of securing web applications against XSS vulnerabilities. Security teams should remain vigilant in implementing secure coding practices and regular security assessments to identify and remediate such vulnerabilities before they can be exploited.

For comprehensive security measures, organizations can explore application security assessments to strengthen their defenses.

In conclusion, organizations should prioritize patching immediately to protect against this vulnerability and to ensure the integrity of their web applications.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Latest CVEs. Recently published vulnerabilities from the NVD database.

View all vulnerabilities
CVE IDSeverity
CVE-2025-65418HIGH
CVE-2025-65417MEDIUM
CVE-2025-65416MEDIUM
CVE-2025-65415MEDIUM
CVE-2025-61314HIGH

Protect Your Business with Hacker-Focused Approach.