CVE-2023-28333

9.8 CRITICAL

📋 TL;DR

CVE-2023-28333 is a Mustache template injection vulnerability in Moodle's pix helper that could allow remote code execution if user input is improperly passed to the helper. The vulnerability affects Moodle installations using custom code that combines the pix helper with untrusted input. While the core Moodle LMS wasn't exploitable, custom plugins or themes could be vulnerable.

💻 Affected Systems

Products:
  • Moodle LMS
Versions: Versions prior to 4.1.5, 4.0.9, 3.11.14, and 3.9.21
Operating Systems: All platforms running Moodle
Default Config Vulnerable: ✅ No
Notes: The vulnerability only affects custom code using the pix helper with user input; core Moodle wasn't exploitable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Limited impact since the core Moodle LMS wasn't exploitable; custom implementations might be vulnerable but require specific conditions.

🟢

If Mitigated

Minimal impact with proper input validation and patching in place.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: LOW

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: HIGH

Exploitation requires custom code that passes user input to the pix helper, making it less likely in standard deployments.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Moodle 4.1.5, 4.0.9, 3.11.14, and 3.9.21

Vendor Advisory: https://moodle.org/mod/forum/discuss.php?d=445065

Restart Required: No

Instructions:

1. Backup your Moodle installation and database. 2. Download the patched version from moodle.org. 3. Replace the affected files or upgrade the entire installation. 4. Verify the fix by checking the version.

🔧 Temporary Workarounds

Input Validation for Custom Code

all

Ensure any custom code using the pix helper properly validates and sanitizes user input before passing it to the helper.

🧯 If You Can't Patch

  • Review and audit any custom plugins or themes for improper use of the pix helper with user input.
  • Implement strict input validation and output encoding in custom code to prevent injection attacks.

🔍 How to Verify

Check if Vulnerable:

Check your Moodle version via the admin panel or by examining the version.php file in the Moodle root directory.

Check Version:

grep -E "\$release|\$version" /path/to/moodle/version.php

Verify Fix Applied:

After patching, confirm the version is 4.1.5, 4.0.9, 3.11.14, or 3.9.21 or later.

📡 Detection & Monitoring

Log Indicators:

  • Unusual requests to Moodle endpoints involving the pix helper or template rendering.

Network Indicators:

  • Suspicious payloads in HTTP requests targeting Moodle, especially with Mustache template syntax.

SIEM Query:

source="moodle_logs" AND (event="template_injection" OR message="pix_helper")

🔗 References

📤 Share & Export