CVE-2021-47904

8.8 HIGH

📋 TL;DR

CVE-2021-47904 is an authenticated file upload vulnerability in PhreeBooks 5.2.3 that allows attackers to upload malicious PHP files through the Image Manager. This leads to remote code execution, enabling attackers to run arbitrary commands on the server. Organizations running vulnerable PhreeBooks installations are affected.

💻 Affected Systems

Products:
  • PhreeBooks
Versions: 5.2.3
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated access to the Image Manager functionality.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise leading to data theft, ransomware deployment, lateral movement within the network, and persistent backdoor installation.

🟠

Likely Case

Attackers gain shell access to the server, allowing them to steal sensitive data, modify or delete files, and use the server for further attacks.

🟢

If Mitigated

With proper file upload restrictions and web application firewalls, exploitation attempts are blocked and logged for investigation.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Multiple public exploits exist with simple file upload mechanisms.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 5.2.4 or later

Vendor Advisory: https://www.phreesoft.com/

Restart Required: No

Instructions:

1. Backup your PhreeBooks installation and database. 2. Download the latest version from the official vendor website. 3. Replace the vulnerable files with patched versions. 4. Verify the Image Manager now restricts file uploads to allowed types only.

🔧 Temporary Workarounds

Restrict File Upload Types

all

Modify the Image Manager to only accept image file extensions (jpg, png, gif, etc.) and reject PHP files.

Modify upload validation in the Image Manager PHP files to check file extensions and MIME types

Web Application Firewall Rules

all

Configure WAF to block file uploads containing PHP code or suspicious patterns.

Add WAF rule: Block requests with Content-Type containing 'php' or file extensions .php, .phtml, .php5, .php7

🧯 If You Can't Patch

  • Disable the Image Manager functionality completely if not needed
  • Implement strict file upload validation at the web server level (e.g., mod_security rules for Apache)

🔍 How to Verify

Check if Vulnerable:

Check if you can upload a file with .php extension through the Image Manager interface while authenticated.

Check Version:

Check the PhreeBooks version in the admin panel or look for version files in the installation directory.

Verify Fix Applied:

Attempt to upload a PHP file through the Image Manager - it should be rejected with an error message.

📡 Detection & Monitoring

Log Indicators:

  • File upload attempts with .php extensions in web server logs
  • Unusual POST requests to Image Manager endpoints
  • Execution of unexpected PHP files in web directories

Network Indicators:

  • Unusual outbound connections from the web server
  • Large file uploads to Image Manager endpoints

SIEM Query:

source="web_logs" AND (uri="/image_manager/upload" OR uri="*upload*") AND (file_extension=".php" OR content_type="application/x-php")

🔗 References

📤 Share & Export