CVE-2021-36547

9.8 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary code on systems running Mara v7.5 by uploading a crafted PHP file to the /codebase/dir.php endpoint. Any organization using Mara v7.5 with the vulnerable component exposed is affected, potentially leading to complete system compromise.

💻 Affected Systems

Products:
  • Mara
Versions: v7.5
Operating Systems: Any OS running PHP (Linux, Windows, etc.)
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default installation of Mara v7.5. No special configuration is required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with attacker gaining root/admin privileges, data exfiltration, ransomware deployment, and persistent backdoor installation.

🟠

Likely Case

Web server compromise leading to website defacement, data theft, and use as pivot point for internal network attacks.

🟢

If Mitigated

Attack blocked at perimeter with no internal access achieved, though attempted exploitation may still cause service disruption.

🌐 Internet-Facing: HIGH - The vulnerable endpoint is directly accessible via web requests, making internet-facing instances immediately exploitable.
🏢 Internal Only: MEDIUM - Internal instances are still vulnerable but require attacker to have network access, reducing exposure surface.

🎯 Exploit Status

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

Exploitation requires only a single HTTP POST request with a crafted PHP file. Public proof-of-concept code is available in the referenced GitHub issues.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: Unknown

Restart Required: No

Instructions:

No official patch is available. Consider upgrading to a newer version if available, or implement workarounds and monitoring.

🔧 Temporary Workarounds

Block vulnerable endpoint

all

Restrict access to /codebase/dir.php endpoint using web server configuration or WAF rules

# Apache: RewriteRule ^/codebase/dir\.php - [F,L]
# Nginx: location ~ /codebase/dir\.php { deny all; }

Disable PHP file uploads

linux

Configure web server to reject PHP file uploads to the vulnerable directory

# .htaccess for Apache: <FilesMatch "\.php$"> Order Allow,Deny Deny from all </FilesMatch>

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Mara instances from critical systems
  • Deploy web application firewall (WAF) with rules to detect and block exploitation attempts

🔍 How to Verify

Check if Vulnerable:

Check if Mara v7.5 is installed and if /codebase/dir.php endpoint is accessible via HTTP requests

Check Version:

Check Mara configuration files or admin interface for version information

Verify Fix Applied:

Test if the vulnerable endpoint is no longer accessible or if PHP file uploads are properly blocked

📡 Detection & Monitoring

Log Indicators:

  • HTTP POST requests to /codebase/dir.php with PHP file uploads
  • Unusual file creation in web directories
  • Suspicious PHP execution in web logs

Network Indicators:

  • HTTP traffic to /codebase/dir.php with file upload parameters
  • Unusual outbound connections from web server

SIEM Query:

source="web_logs" AND (uri="/codebase/dir.php" OR uri CONTAINS "dir.php") AND method="POST" AND (file_extension="php" OR content_type CONTAINS "php")

🔗 References

📤 Share & Export