CVE-2024-40645

8.8 HIGH

📋 TL;DR

This vulnerability allows authenticated users in FOG Project to upload malicious files disguised as images, leading to remote code execution on the server. Attackers can append PHP webshells to image files and bypass file extension checks. All FOG Project installations below version 1.5.10.41 with authenticated user access are affected.

💻 Affected Systems

Products:
  • FOG Project
Versions: All versions below 1.5.10.41
Operating Systems: Linux (primary deployment)
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated user access to the FOG web interface. The rebranding feature must be accessible to the user.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full server compromise allowing attackers to execute arbitrary commands, steal sensitive data, deploy ransomware, or pivot to other network systems.

🟠

Likely Case

Attackers upload PHP webshells to gain persistent access, execute commands, and potentially compromise the entire FOG management infrastructure.

🟢

If Mitigated

With proper file upload validation and web server restrictions, impact is limited to potential file storage abuse without code execution.

🌐 Internet-Facing: HIGH - If the FOG web interface is exposed to the internet, attackers can exploit this after obtaining valid credentials.
🏢 Internal Only: HIGH - Even internally, authenticated malicious users or compromised accounts can exploit this vulnerability.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authenticated access but is technically simple - involves uploading a malicious file with PHP code appended to an image.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.5.10.41

Vendor Advisory: https://github.com/FOGProject/fogproject/security/advisories/GHSA-59mq-q8g5-2f4f

Restart Required: Yes

Instructions:

1. Backup your FOG configuration and database. 2. Update FOG Project to version 1.5.10.41 or later. 3. Restart the web server (Apache/Nginx). 4. Verify the patch is applied by checking the version.

🔧 Temporary Workarounds

Restrict file upload extensions

linux

Configure web server to block execution of uploaded files in the rebranding directory

# For Apache: Add to .htaccess in upload directory
<FilesMatch "\.(php|php3|php4|php5|phtml|pl|cgi)">
  Order Deny,Allow
  Deny from all
</FilesMatch>
# For Nginx: Add to server config
location ~* \.(php|php3|php4|php5|phtml|pl|cgi)$ {
  deny all;
}

Disable rebranding feature

linux

Temporarily disable the vulnerable rebranding feature until patching

# Remove or restrict access to rebranding functionality
# Modify FOG configuration to disable client banner uploads

🧯 If You Can't Patch

  • Restrict user permissions to limit who can access the rebranding feature
  • Implement web application firewall (WAF) rules to block suspicious file upload patterns

🔍 How to Verify

Check if Vulnerable:

Check if FOG version is below 1.5.10.41 and if authenticated users can upload files via the rebranding feature without proper extension validation.

Check Version:

cat /var/www/html/fog/lib/fog/System.class.php | grep "define.*FOG_VERSION"

Verify Fix Applied:

After updating to 1.5.10.41, attempt to upload a file with PHP extension via rebranding feature - it should be rejected.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file uploads to rebranding directory
  • PHP file execution from upload directories
  • Multiple failed upload attempts with suspicious extensions

Network Indicators:

  • HTTP POST requests to rebranding endpoints with file uploads
  • Unexpected outbound connections from FOG server

SIEM Query:

source="fog_access.log" AND (uri_path="/fog/management/index.php?node=client&sub=edit" OR uri_path LIKE "%/rebranding%") AND (method="POST" AND size>100000)

🔗 References

📤 Share & Export