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-0332

CVE-2022-0332: Moodle SQL Injection Vulnerability

CVE-2022-0332 is an SQL injection vulnerability in Moodle's h5p activity web service that affects versions 3.11 to 3.11.4. This flaw allows attackers to manipulate database queries. This article covers technical details, affected versions, impact, and mitigation strategies.

Updated: May 16, 2026

CVE-2022-0332 Overview

CVE-2022-0332 is a SQL injection vulnerability affecting Moodle versions 3.11 through 3.11.4. The flaw resides in the H5P activity web service responsible for fetching user attempt data. An unauthenticated attacker can inject crafted SQL through the vulnerable service, manipulating database queries against the Moodle backend.

The vulnerability is classified under [CWE-89] (Improper Neutralization of Special Elements used in an SQL Command). Moodle is a widely deployed open-source learning management system used by universities, schools, and enterprises, making this flaw relevant to organizations operating online education infrastructure.

Critical Impact

A remote attacker can execute arbitrary SQL queries against the Moodle database, potentially exposing user credentials, grades, and personal data, or altering academic records.

Affected Products

  • Moodle 3.11
  • Moodle 3.11.1 through 3.11.3
  • Moodle 3.11.4

Discovery Timeline

  • 2022-01-25 - CVE-2022-0332 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-0332

Vulnerability Analysis

The vulnerability exists in the H5P activity component of Moodle. H5P is an interactive content framework integrated into Moodle for quizzes, presentations, and learning materials. The web service that retrieves user attempt data fails to properly sanitize input parameters before incorporating them into SQL queries.

An attacker submits crafted parameters to the affected H5P web service endpoint. The Moodle backend concatenates the attacker-controlled input into a SQL statement without adequate parameterization or escaping. The database server then executes the injected SQL fragments alongside the intended query.

Successful exploitation grants the attacker read and potentially write access to arbitrary tables in the Moodle database. This includes the mdl_user table holding password hashes, session tokens, and personally identifiable information.

Root Cause

The root cause is improper neutralization of special elements in SQL commands within the H5P attempt-fetching service. Input parameters used to construct database queries bypass Moodle's standard data manipulation layer safeguards. Developers introduced raw query concatenation rather than using the framework's parameterized query API.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker sends HTTP requests carrying malicious SQL payloads to the Moodle H5P web service endpoint. The vulnerability description does not enumerate the specific parameter or endpoint path, and no public proof-of-concept code is referenced in the advisory.

For technical specifics, refer to the Red Hat Bug Report #2043661 and the Moodle Forum Discussion #431099.

Detection Methods for CVE-2022-0332

Indicators of Compromise

  • Unexpected HTTP requests to H5P activity web service endpoints containing SQL metacharacters such as single quotes, UNION, SELECT, or comment sequences (--, /*).
  • Database error messages in Moodle logs referencing malformed queries originating from H5P attempt requests.
  • Anomalous read activity against mdl_user, mdl_user_password_history, or mdl_sessions tables from web application sessions.

Detection Strategies

  • Inspect Moodle web server access logs for requests to /mod/h5pactivity/ paths containing encoded SQL syntax or unusually long query strings.
  • Deploy a web application firewall ruleset that flags SQL injection patterns targeting Moodle endpoints.
  • Correlate database slow-query logs with web requests to identify suspect injection attempts producing large result sets.

Monitoring Recommendations

  • Enable Moodle debug logging at the database query level in non-production environments to baseline normal H5P traffic.
  • Forward web, application, and database logs to a centralized analytics platform for cross-source correlation.
  • Alert on authentication anomalies following suspected injection activity, including new admin accounts or password resets.

How to Mitigate CVE-2022-0332

Immediate Actions Required

  • Upgrade Moodle to version 3.11.5 or later, which contains the official fix from the Moodle security team.
  • Audit Moodle administrator and teacher accounts for unauthorized changes or new privileged users.
  • Rotate database credentials and force password resets for all Moodle users if exploitation is suspected.

Patch Information

Moodle addressed the vulnerability in releases following 3.11.4. Administrators should consult the Moodle Forum Discussion #431099 for upgrade guidance and apply the security release through standard Moodle upgrade procedures.

Workarounds

  • Restrict access to the H5P activity module by disabling it under Site administration until patching is complete.
  • Place Moodle behind a web application firewall configured with SQL injection signatures.
  • Limit database account privileges so the Moodle application user cannot access tables outside its required scope.
bash
# Configuration example: disable H5P activity module pending patch
php admin/cli/uninstall_plugins.php --plugins=mod_h5pactivity --run
# Verify Moodle version after upgrade
php admin/cli/cfg.php --name=release

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 Probability3.10%

  • 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
  • Technical References
  • Red Hat Bug Report #2043661
  • Vendor Resources
  • Moodle Forum Discussion #431099
  • Related CVEs
  • CVE-2025-26533: Moodle SQL Injection Vulnerability

  • CVE-2022-0983: Moodle SQL Injection Vulnerability

  • CVE-2021-36393: Moodle SQL Injection Vulnerability

  • CVE-2022-50943: Moodle LMS 4.0 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