CVE-2021-35414

9.8 CRITICAL

📋 TL;DR

CVE-2021-35414 is an unauthenticated SQL injection vulnerability in Chamilo LMS v1.11.x that allows attackers to execute arbitrary SQL commands via the 'doc' parameter in the Compilatio plagiarism module. This affects all Chamilo LMS installations using vulnerable versions with the Compilatio module enabled. Attackers can potentially access, modify, or delete database content without authentication.

💻 Affected Systems

Products:
  • Chamilo LMS
Versions: v1.11.x (specifically v1.11.8 and earlier)
Operating Systems: All platforms running Chamilo LMS
Default Config Vulnerable: ⚠️ Yes
Notes: Requires the Compilatio plagiarism module to be installed and accessible. The vulnerability is in the upload.php file within this module.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the Chamilo database leading to data theft, data destruction, privilege escalation to administrative access, and potential remote code execution through database functions.

🟠

Likely Case

Extraction of sensitive user data (credentials, personal information), manipulation of course content and grades, and potential lateral movement within the system.

🟢

If Mitigated

Limited impact if proper input validation and parameterized queries are implemented, with database permissions restricted to minimum necessary privileges.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Multiple public writeups and proof-of-concept examples exist. The vulnerability requires no authentication and has straightforward exploitation vectors.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Chamilo LMS v1.11.10 and later (patches available in commits 36149c1, 6a98e32, f398b5b)

Vendor Advisory: https://github.com/chamilo/chamilo-lms/security/advisories

Restart Required: No

Instructions:

1. Update to Chamilo LMS v1.11.10 or later. 2. Apply the specific commits that fix the SQL injection in main/plagiarism/compilatio/upload.php. 3. Verify the patch by checking that parameterized queries or proper input validation is implemented for the 'doc' parameter.

🔧 Temporary Workarounds

Disable Compilatio Module

linux

Temporarily disable or remove the Compilatio plagiarism module to prevent exploitation while patching.

mv main/plagiarism/compilatio/upload.php main/plagiarism/compilatio/upload.php.disabled

Web Application Firewall Rule

all

Implement WAF rules to block SQL injection patterns targeting the vulnerable endpoint.

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for the 'doc' parameter in upload.php using prepared statements with parameterized queries.
  • Restrict network access to the Chamilo instance using firewall rules to limit exposure to trusted IP addresses only.

🔍 How to Verify

Check if Vulnerable:

Check if your Chamilo version is 1.11.8 or earlier and if the file main/plagiarism/compilatio/upload.php exists without the security patches applied.

Check Version:

Check the version in Chamilo's main/inc/conf/configuration.php or via the admin interface.

Verify Fix Applied:

Verify that the upload.php file includes proper input validation (e.g., prepared statements) for the 'doc' parameter and that your Chamilo version is 1.11.10 or later.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in application logs related to upload.php
  • Multiple failed SQL query attempts with malformed 'doc' parameter values
  • Unexpected database queries originating from the Compilatio module

Network Indicators:

  • HTTP requests to /main/plagiarism/compilatio/upload.php with SQL injection patterns in parameters
  • Unusual outbound database connections from the web server

SIEM Query:

source="web_logs" AND uri="/main/plagiarism/compilatio/upload.php" AND (param="doc" AND value MATCHES "(?i)(SELECT|UNION|INSERT|DELETE|UPDATE|DROP|OR|AND|'|--|#|;)")

🔗 References

📤 Share & Export