The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2022-50943

CVE-2022-50943: Moodle LMS 4.0 XSS Vulnerability

CVE-2022-50943 is a cross-site scripting flaw in Moodle LMS 4.0 that allows attackers to inject malicious scripts through the search parameter. This article covers technical details, affected versions, and mitigation.

Published: May 18, 2026

CVE-2022-50943 Overview

CVE-2022-50943 is a reflected cross-site scripting (XSS) vulnerability in Moodle LMS 4.0. The flaw exists in course/search.php, where the application reflects the search request parameter into the response without proper output encoding. Unauthenticated attackers can craft URLs containing JavaScript payloads that execute in a victim's browser when the link is opened. Successful exploitation allows session cookie theft, account takeover within the learning management system, and arbitrary actions performed in the victim's authenticated context. The issue is tracked under CWE-79 (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Unauthenticated attackers can execute arbitrary JavaScript in the browsers of authenticated Moodle users, enabling session hijacking and impersonation of students, teachers, and administrators.

Affected Products

  • Moodle LMS 4.0
  • Deployments exposing course/search.php to untrusted users
  • Self-hosted Moodle instances on the affected branch

Discovery Timeline

  • 2026-05-10 - CVE-2022-50943 published to NVD
  • 2026-05-13 - Last updated in NVD database

Technical Details for CVE-2022-50943

Vulnerability Analysis

The vulnerability resides in the course search functionality of Moodle LMS 4.0. The course/search.php endpoint accepts a search query parameter and renders its value back into the HTML response. The application fails to apply contextual output encoding before placing user input into the page. An attacker who crafts a malicious URL can inject HTML and JavaScript that the victim's browser parses and executes in the origin of the Moodle deployment.

Because the vulnerable endpoint is reachable without authentication, attackers can stage payloads and distribute them through email, forum posts, or social engineering. When an authenticated user follows the link, the injected script runs with that user's privileges in the Moodle session.

The Exploit Prediction Scoring System (EPSS) probability is 0.109%. A proof of concept is publicly available through Exploit-DB #51115 and the VulnCheck Advisory on Moodle.

Root Cause

The root cause is missing sanitization and output encoding of the search parameter before it is reflected into the HTML response by course/search.php. User-controlled input is treated as trusted markup rather than data, allowing breakout from the intended text context into script execution.

Attack Vector

The attack vector is network-based and requires user interaction. An attacker constructs a URL pointing to the vulnerable Moodle host with a JavaScript payload supplied through the search parameter. The victim must open the crafted link in an authenticated session. The payload then executes in the victim's browser, accessing cookies, document content, and any APIs available to the session. Refer to the VulnCheck Advisory on Moodle for technical details and a reproduction recipe.

Detection Methods for CVE-2022-50943

Indicators of Compromise

  • HTTP requests to course/search.php containing URL-encoded <script>, onerror=, onload=, or javascript: sequences in the search parameter
  • Web server access logs showing unusually long or encoded search query strings from external referrers
  • Outbound requests from user browsers to unfamiliar domains immediately after visiting course/search.php
  • Reports of unexpected session terminations or session reuse from new IP addresses following a phishing campaign

Detection Strategies

  • Inspect web server and application logs for search parameter values containing HTML tags, event handlers, or encoded script markers
  • Deploy a web application firewall (WAF) rule that flags reflected XSS patterns on the Moodle course search endpoint
  • Correlate authenticated Moodle session activity with suspicious referrer URLs containing course/search.php?search=
  • Hunt for anomalous administrator or teacher actions occurring shortly after a search request with attacker-controlled input

Monitoring Recommendations

  • Forward Moodle web server logs to a centralized logging platform and alert on payloads matching XSS signatures
  • Monitor for new or modified Moodle user roles, password changes, and API token generation following suspicious requests
  • Track browser-side errors and Content Security Policy (CSP) violation reports if CSP is enabled

How to Mitigate CVE-2022-50943

Immediate Actions Required

  • Upgrade Moodle LMS 4.0 to the latest supported release that addresses the XSS in course/search.php
  • Restrict access to the Moodle instance to authenticated users where business requirements allow
  • Force session invalidation for users who may have followed suspicious links to course/search.php
  • Communicate phishing awareness guidance to staff and students using the platform

Patch Information

Moodle maintains source code at the Moodle Git Repository and distributes releases through the Moodle Official Site. Administrators should apply the latest stable update for the 4.0 branch or move to a supported successor release. Validate that course/search.php properly encodes the search parameter on output after upgrading.

Workarounds

  • Deploy a WAF rule that blocks requests to course/search.php containing HTML tags, JavaScript event handlers, or javascript: URIs in the search parameter
  • Enable a strict Content Security Policy that disallows inline scripts and restricts script sources to trusted origins
  • Set the HttpOnly and Secure flags on Moodle session cookies to reduce the impact of script-based cookie theft
  • Limit network exposure of the Moodle instance to known IP ranges or VPN users until patching is complete

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechMoodle

  • SeverityMEDIUM

  • CVSS Score5.1

  • EPSS Probability0.11%

  • Known ExploitedNo
  • CVSS Vector
  • 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • Moodle Git Repository

  • Moodle Official Site

  • Exploit-DB #51115

  • VulnCheck Advisory on Moodle
  • Related CVEs
  • CVE-2025-67855: Moodle Reflected XSS Vulnerability

  • CVE-2025-67849: Moodle AI Prompt XSS Vulnerability

  • CVE-2025-67850: Moodle Formula Editor XSS Vulnerability

  • CVE-2021-47857: Moodle Calendar XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English