CVE-2021-40848

7.8 HIGH

📋 TL;DR

This CVE describes a CSV injection vulnerability in Mahara e-portfolio software where exported CSV files could contain malicious formulas that spreadsheet programs might execute. This allows attackers to potentially execute commands on a victim's local machine when they open the CSV file. Affected users are anyone using vulnerable Mahara versions who exports and opens CSV files.

💻 Affected Systems

Products:
  • Mahara
Versions: Mahara versions before 20.04.5, 20.10.3, 21.04.2, and 21.10.0
Operating Systems: All operating systems running Mahara
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in CSV export functionality; affects all default configurations with CSV export enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution on victim's machine when they open a malicious CSV file in a vulnerable spreadsheet application, potentially leading to full system compromise.

🟠

Likely Case

Local command execution or formula injection in spreadsheet applications, potentially stealing data or executing malicious scripts on the user's system.

🟢

If Mitigated

No impact if users don't open CSV files from untrusted sources or if spreadsheet applications have security features enabled to block formula execution.

🌐 Internet-Facing: MEDIUM - Attackers can craft malicious CSV exports that users might download and open, but requires user interaction.
🏢 Internal Only: MEDIUM - Similar risk internally if users open CSV files from untrusted sources within the organization.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW - Requires user to export and open a malicious CSV file.

Exploitation requires user interaction (opening CSV file) and depends on spreadsheet application behavior.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Mahara 20.04.5, 20.10.3, 21.04.2, or 21.10.0

Vendor Advisory: https://mahara.org/interaction/forum/topic.php?id=8950

Restart Required: No

Instructions:

1. Backup your Mahara installation and database. 2. Download the patched version from Mahara's official website. 3. Follow Mahara's upgrade instructions for your specific version. 4. Verify the upgrade completed successfully.

🔧 Temporary Workarounds

Disable CSV Export

all

Temporarily disable CSV export functionality in Mahara to prevent exploitation.

Edit Mahara configuration to disable CSV export features

User Education

all

Educate users to only open CSV files from trusted sources and to use text editors instead of spreadsheet applications for unknown files.

🧯 If You Can't Patch

  • Implement strict access controls to limit who can export CSV files
  • Deploy endpoint protection that blocks execution of formulas in CSV files

🔍 How to Verify

Check if Vulnerable:

Check your Mahara version via admin panel or by examining version files. If version is before 20.04.5, 20.10.3, 21.04.2, or 21.10.0, you are vulnerable.

Check Version:

Check Mahara admin panel or examine version.php file in Mahara installation directory.

Verify Fix Applied:

After patching, verify version shows 20.04.5, 20.10.3, 21.04.2, 21.10.0 or later. Test CSV export functionality to ensure it works without formula injection.

📡 Detection & Monitoring

Log Indicators:

  • Unusual CSV export patterns
  • Multiple failed export attempts
  • Large CSV file exports

Network Indicators:

  • CSV file downloads from Mahara instance
  • Unusual file transfer patterns

SIEM Query:

source="mahara" AND (event="csv_export" OR file_type="csv")

🔗 References

📤 Share & Export