{"id":"CVE-2022-50943","summary":"Moodle LMS 4.0 Cross-Site Scripting via course search.php","details":"Moodle LMS 4.0 contains a cross-site scripting vulnerability that allows unauthenticated attackers to inject malicious scripts by submitting payloads through the search parameter. Attackers can inject JavaScript code via the search field in course/search.php to execute arbitrary scripts in users' browsers and steal session cookies.","aliases":["BIT-moodle-2022-50943"],"modified":"2026-07-08T07:34:15.105427616Z","published":"2026-05-10T12:12:44.418Z","database_specific":{"cwe_ids":["CWE-79"],"unresolved_ranges":[{"extracted_events":[{"introduced":"4.0"},{"last_affected":"4.0"}],"source":"AFFECTED_FIELD"}],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50943.json","cna_assigner":"VulnCheck"},"references":[{"type":"WEB","url":"https://git.in.moodle.com/moodle"},{"type":"WEB","url":"https://moodle.org/"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50943.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50943"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/moodle-lms-cross-site-scripting-via-course-search-php"},{"type":"EVIDENCE","url":"https://www.exploit-db.com/exploits/51115"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/moodle/moodle","events":[{"introduced":"0"},{"last_affected":"8b359ad7a63cf219110bca80552fe3d4ea2a635d"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"last_affected":"4.0.0"}],"cpe":"cpe:2.3:a:moodle:moodle:*:*:*:*:*:*:*:*","source":"CPE_RANGE"}}],"versions":["v4.0.0","v4.0.0-rc2","v4.0.0-rc3","v4.0.0-rc4","v4.0.0-rc1","v4.0.0-beta","v3.9.0-rc2","v3.9.0","v3.9.0-rc3","v3.9.0-rc1","v3.9.0-beta","v3.8.0","v3.8.0-rc1","v3.8.0-beta","v3.7.0","v3.7.0-rc2","v3.7.0-rc1","v3.7.0-beta","v3.6.0","v3.6.0-rc2","v3.6.0-rc3","v3.6.0-rc1","v3.6.0-beta","v3.5.0","v3.5.0-rc1","v3.5.0-beta","v3.4.0","v3.4.0-rc2","v3.4.0-rc3","v3.4.0-rc1","v3.4.0-beta","v3.3.0","v3.3.0-rc3","v3.3.0-rc2","v3.3.0-rc1","v3.3.0-beta","v3.2.0-rc2","v3.2.0","v3.2.0-rc4","v3.2.0-beta","v3.2.0-rc5","v3.2.0-rc3","v3.2.0-rc1","v3.1.0-beta","v3.1.0","v3.1.0-rc2","v3.1.0-rc1","v3.0.0-rc3","v3.0.0","v3.0.0-rc4","v3.0.0-rc2","v3.0.0-rc1","v3.0.0-beta","v2.9.0","v2.9.0-rc2","v2.9.0-rc1","v2.9.0-beta","v2.8.0","v2.8.0-rc2","v2.8.0-rc1","v2.8.0-beta","v2.7.0","v2.7.0-rc2","v2.7.0-rc1","v2.7.0-beta","v2.6.0","v2.6.0-rc1","v2.6.0-beta","v2.5.0","v2.5.0-rc1","v2.5.0-beta","v2.4.0-beta","v2.4.0-rc1","v2.4.0","v2.3.0","v2.3.0-rc1","v2.3.0-beta","v2.2.0","v2.2.0-rc1","v2.2.0-beta","v2.1.0","v2.0.1","v2.0.0","v2.0.0-rc2","v2.0.0-rc1","v1.3.0","v1.2.1","v1.2.0","v1.1.1","v1.1.0","v1.0.9","v1.0.8","v1.0.7","v1.0.6","v1.0.5","v1.0.4","v1.0.3","v1.0.2","v1.0.1","v1.0.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50943.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"}]}