# CVE-2022-50943: Moodle LMS cross-site scripting in course search

Source: https://junglewise.ai/threats/cve-2022-50943-moodle-lms-cross-site-scripting-in-course-search  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-10. Updated: 2026-05-27  
License: CC BY 4.0 with a link back

CVE-2022-50943 · Severity: medium · CVSS 6.1 · Published 2026-05-10

Moodle LMS, a widely used open-source learning platform, is vulnerable to a security flaw in its course search feature. An attacker can use this to run malicious scripts in the browsers of other users, potentially leading to the theft of login sessions or sensitive personal information. This could allow an unauthorized person to take over user accounts or disrupt educational activities.

Technologies: [Moodle](https://junglewise.ai/threats/technologies/moodle). Vendors: [Moodle](https://junglewise.ai/threats/vendors/moodle).

## Quick answers

**Is CVE-2022-50943 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-50943 being exploited in the wild.

**How severe is CVE-2022-50943?** Medium severity, with a CVSS score of 6.1, published 10 May 2026.

**Which products and versions are affected?** Moodle Moodle LMS 4.0.0 and earlier.

**Is there a fix for CVE-2022-50943?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2022-50943 attacked?** It is attacked over the network, in a web application.

**Am I affected by CVE-2022-50943?** Check whether you run Moodle. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A reflected cross-site scripting (XSS) vulnerability exists in Moodle LMS versions up to and including 4.0.0. The flaw is located in 'course/search.php' due to improper neutralization of the 'search' parameter before it is echoed back to the page via the search_courses method. An unauthenticated remote attacker can craft a malicious URL containing a JavaScript payload; if a user visits this link, the script executes in their browser context. This can be used to steal session cookies, perform actions on behalf of the user, or deface the site. Public exploit code is available.

## Affected products

- Moodle Moodle LMS 4.0.0 and earlier

## Timeline

- 2022-10-26: other: Vulnerability discovered by researcher
- 2023-03-28: disclosed: Exploit published on Exploit-DB
- 2026-05-10: advisory: NVD/VulnCheck advisory published

## References

- [https://git.in.moodle.com/moodle](https://git.in.moodle.com/moodle)
- [https://moodle.org/](https://moodle.org/)
- [https://www.exploit-db.com/exploits/51115](https://www.exploit-db.com/exploits/51115)
- [https://www.vulncheck.com/advisories/moodle-lms-cross-site-scripting-via-course-search-php](https://www.vulncheck.com/advisories/moodle-lms-cross-site-scripting-via-course-search-php)

## Related threats

- [Moodle insufficient access control in H5P content files](https://junglewise.ai/threats/cve-2026-123655-a-flaw-was-found-in-moodle-insufficient-access-control-checks-on)
- [Moodle missing capability check in core_grades_get_gradeitems](https://junglewise.ai/threats/cve-2026-119556-moodle-4-2-0-through-4-5-15-5-0-0-through-5-0-11-5-1-0-through-5)
- [Moodle core_grades_get_feedback information disclosure](https://junglewise.ai/threats/cve-2026-119555-moodle-4-2-0-through-4-5-15-5-0-0-through-5-0-11-5-1-0-through-5)
- [Moodle SQL injection in External database enrolment plugin](https://junglewise.ai/threats/cve-2026-119554-moodle-5-3-0-5-2-0-through-5-2-4-5-1-0-through-5-1-8-5-0-0)
- [Moodle path traversal in Blackboard question import](https://junglewise.ai/threats/cve-2026-119553-moodle-5-3-0-5-2-0-through-5-2-4-5-1-0-through-5-1-8-5-0-0)
