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
    • 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-2021-36393

CVE-2021-36393: Moodle SQL Injection Vulnerability

CVE-2021-36393 is an SQL injection flaw in Moodle that affects the library fetching recent courses, allowing potential database manipulation. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-36393 Overview

CVE-2021-36393 is a critical SQL injection vulnerability identified in Moodle, the widely-used open-source learning management system (LMS). The vulnerability exists in the library responsible for fetching a user's recent courses, allowing attackers to inject malicious SQL commands through user-supplied input. This flaw enables unauthorized database access, potentially exposing sensitive educational data, user credentials, and system configurations.

Critical Impact

This SQL injection vulnerability allows unauthenticated remote attackers to execute arbitrary SQL commands against the Moodle database, potentially leading to complete database compromise, data exfiltration, and system takeover.

Affected Products

  • Moodle LMS (multiple versions affected)
  • Moodle Moodle (all installations using vulnerable recent courses library)
  • Educational institutions and organizations running unpatched Moodle deployments

Discovery Timeline

  • 2023-03-06 - CVE-2021-36393 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-36393

Vulnerability Analysis

This SQL injection vulnerability (CWE-89) resides in the Moodle library function that retrieves a user's recently accessed courses. The vulnerability allows attackers to manipulate SQL queries by injecting malicious input through parameters that are not properly sanitized before being incorporated into database queries. The attack can be executed remotely over the network without requiring authentication or user interaction, making it particularly dangerous for publicly accessible Moodle installations.

Successful exploitation could allow an attacker to read, modify, or delete sensitive information from the database, bypass authentication mechanisms, escalate privileges, or potentially achieve remote code execution depending on the database configuration and permissions.

Root Cause

The root cause of this vulnerability is improper input validation and lack of parameterized queries in the recent courses library component. User-supplied data is concatenated directly into SQL statements without proper sanitization or the use of prepared statements. This allows attackers to break out of the intended query structure and inject arbitrary SQL commands that will be executed by the database server with the application's privileges.

Attack Vector

The vulnerability is exploited remotely over the network. An attacker can craft malicious requests targeting the recent courses functionality, embedding SQL injection payloads in parameters that are processed by the vulnerable library. Since the attack requires no authentication or user interaction, any exposed Moodle instance is at risk. The attacker sends specially crafted input that, when processed by the application, causes the injected SQL to execute against the backend database.

The attack typically follows this pattern: the attacker identifies the vulnerable parameter in the recent courses API or functionality, then crafts a payload containing SQL syntax that escapes the original query context and appends additional SQL commands. These injected commands can enumerate database tables, extract sensitive data such as user credentials and personal information, or modify database contents.

Detection Methods for CVE-2021-36393

Indicators of Compromise

  • Unusual database query patterns or errors in Moodle application logs
  • Unexpected SQL syntax appearing in web server access logs or request parameters
  • Database audit logs showing queries containing SQL keywords like UNION, SELECT, DROP, or INSERT in user-controllable input fields
  • Signs of data exfiltration or unauthorized access to student/instructor records

Detection Strategies

  • Deploy Web Application Firewalls (WAF) with SQL injection detection rules targeting Moodle endpoints
  • Implement database activity monitoring to detect anomalous query patterns
  • Monitor Moodle access logs for requests containing SQL injection patterns (single quotes, double dashes, semicolons, SQL keywords)
  • Enable verbose logging on the database server to capture and alert on suspicious queries

Monitoring Recommendations

  • Configure real-time alerting for SQL error messages in Moodle logs
  • Establish baseline metrics for database query volumes and alert on significant deviations
  • Monitor for unauthorized data access patterns, especially bulk data retrieval from user and course tables
  • Implement integrity monitoring on critical Moodle database tables

How to Mitigate CVE-2021-36393

Immediate Actions Required

  • Update Moodle to the latest patched version immediately
  • Review and restrict database user privileges to the minimum required
  • Implement Web Application Firewall rules to block SQL injection attempts
  • Audit database access logs for signs of prior exploitation

Patch Information

Moodle has released security patches addressing this vulnerability. Administrators should consult the Moodle Security Advisory for detailed patch information and upgrade instructions. It is strongly recommended to upgrade to the latest stable Moodle release that includes fixes for this SQL injection vulnerability.

Workarounds

  • Deploy a Web Application Firewall with SQL injection filtering rules in front of Moodle
  • Restrict network access to the Moodle instance to trusted IP ranges where possible
  • Implement additional input validation at the reverse proxy or load balancer level
  • Consider temporarily disabling the recent courses functionality if the component can be isolated
bash
# Example: Apache ModSecurity rule to help mitigate SQL injection
# Add to your ModSecurity configuration
SecRule ARGS "@detectSQLi" "id:1001,phase:2,deny,status:403,msg:'SQL Injection Attempt Blocked'"

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

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechMoodle

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability26.77%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-89
  • Vendor Resources
  • Moodle Forum Discussion
  • Related CVEs
  • CVE-2025-26533: Moodle SQL Injection Vulnerability

  • CVE-2022-0983: Moodle SQL Injection Vulnerability

  • CVE-2022-0332: Moodle SQL Injection Vulnerability

  • CVE-2026-30884: Moodle CustomCert Info Disclosure Flaw
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