CVE-2021-45010

8.8 HIGH

📋 TL;DR

This is an authenticated path traversal vulnerability in Tiny File Manager that allows users with valid accounts to upload malicious PHP files to the webroot directory. Successful exploitation leads to remote code execution on the server. Any system running vulnerable versions of Tiny File Manager with file upload functionality enabled is affected.

💻 Affected Systems

Products:
  • Tiny File Manager
Versions: All versions before 2.4.7
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authentication but default credentials are often unchanged (admin:admin@123). File upload functionality must be enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise allowing attackers to execute arbitrary code, steal data, install backdoors, pivot to other systems, and maintain persistent access.

🟠

Likely Case

Webshell deployment leading to data exfiltration, credential theft, and further lateral movement within the network.

🟢

If Mitigated

Limited impact if proper file upload restrictions, web application firewalls, and least privilege access controls are implemented.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Multiple public exploits available including shell upload scripts. Requires valid credentials but default credentials are commonly used.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.4.7

Vendor Advisory: https://github.com/prasathmani/tinyfilemanager/commit/2046bbde72ed76af0cfdcae082de629bcc4b44c7

Restart Required: No

Instructions:

1. Download Tiny File Manager version 2.4.7 or later from the official GitHub repository. 2. Replace the existing tinyfilemanager.php file with the patched version. 3. Verify the fix by checking the version number in the application.

🔧 Temporary Workarounds

Disable file upload functionality

all

Temporarily disable file uploads in Tiny File Manager configuration

Edit tinyfilemanager.php and set 'allow_upload' to false in configuration section

Restrict upload directory permissions

linux

Set strict permissions on upload directories to prevent PHP execution

chmod 755 /path/to/tinyfilemanager/uploads
chown www-data:www-data /path/to/tinyfilemanager/uploads

🧯 If You Can't Patch

  • Change default credentials and enforce strong password policies
  • Implement web application firewall rules to block path traversal attempts and PHP file uploads

🔍 How to Verify

Check if Vulnerable:

Check the version number in tinyfilemanager.php file header or login page. Versions below 2.4.7 are vulnerable.

Check Version:

grep -i 'version' tinyfilemanager.php | head -1

Verify Fix Applied:

Attempt to upload a PHP file with path traversal payload (e.g., '../../shell.php') - should be blocked in patched versions.

📡 Detection & Monitoring

Log Indicators:

  • File upload attempts with '..' sequences in filenames
  • PHP file uploads to non-standard directories
  • Multiple failed login attempts followed by successful upload

Network Indicators:

  • POST requests to upload endpoint with suspicious filenames
  • HTTP requests to newly uploaded PHP files

SIEM Query:

source="web_logs" AND (uri="*/tinyfilemanager.php*" AND (method="POST" AND (filename="*..*" OR filename="*.php")))

🔗 References

📤 Share & Export