CVE-2021-37221

8.8 HIGH

📋 TL;DR

This vulnerability allows remote attackers to upload arbitrary PHP files through the account update and customer creation features in Sourcecodester Customer Relationship Management System 1.0. Successful exploitation could lead to remote code execution on the web server. Organizations using this specific CRM version are affected.

💻 Affected Systems

Products:
  • Sourcecodester Customer Relationship Management System
Versions: 1.0
Operating Systems: Any OS running PHP web server
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the default installation with no additional security configurations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise via remote code execution, allowing attacker to execute arbitrary commands, steal data, install backdoors, or pivot to other systems.

🟠

Likely Case

Webshell deployment leading to data theft, defacement, or use as a foothold for further attacks within the network.

🟢

If Mitigated

Limited impact if file uploads are restricted to non-executable directories or proper file type validation is implemented.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploit requires authentication but is trivial to execute once authenticated. Public exploit code is available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch exists. Consider upgrading to a newer version if available or implementing workarounds.

🔧 Temporary Workarounds

File Upload Restriction

all

Implement server-side file type validation to only allow specific non-executable file extensions.

Web Server Configuration

all

Configure web server to prevent execution of uploaded files in upload directories.

For Apache: Add 'php_flag engine off' to .htaccess in upload directory
For Nginx: Add 'location ~* \.php$ { deny all; }' to upload directory config

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block file uploads with PHP extensions
  • Restrict access to the CRM system to trusted IP addresses only

🔍 How to Verify

Check if Vulnerable:

Attempt to upload a PHP file through account update or customer creation features. If successful without validation, system is vulnerable.

Check Version:

Check the CRM system version in the admin panel or about page.

Verify Fix Applied:

Attempt to upload a PHP file - it should be rejected or saved in a non-executable manner.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file uploads with .php extensions
  • Multiple failed upload attempts followed by successful PHP file upload
  • Web server logs showing execution of files from upload directories

Network Indicators:

  • POST requests to upload endpoints with PHP file content
  • Unusual outbound connections from web server after file upload

SIEM Query:

source="web_server" AND (uri="*update*" OR uri="*create*") AND method="POST" AND (file_extension=".php" OR content_type="application/x-php")

🔗 References

📤 Share & Export