CVE-2019-19576

9.8 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary code by uploading malicious .phar files to systems using vulnerable versions of verot.net class.upload library. The library failed to block .phar extensions, enabling PHP Archive files to be uploaded and executed. This affects Joomla! K2 extension users and any other applications using class.upload.php versions before 1.0.3 or 2.x before 2.0.4.

💻 Affected Systems

Products:
  • verot.net class.upload library
  • Joomla! K2 extension
  • Other applications using class.upload.php
Versions: class.upload versions < 1.0.3, 2.x versions < 2.0.4
Operating Systems: All platforms running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with file upload functionality enabled using the vulnerable library.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with remote code execution, allowing attackers to take complete control of the server, steal data, install malware, or pivot to other systems.

🟠

Likely Case

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

🟢

If Mitigated

File uploads blocked or properly validated, limiting impact to denial of service or failed upload attempts.

🌐 Internet-Facing: HIGH - Web applications with file upload functionality are directly exposed to remote attackers.
🏢 Internal Only: MEDIUM - Internal applications with file upload could be exploited by authenticated users or through other attack vectors.

🎯 Exploit Status

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

Multiple public exploits exist, requiring only ability to upload files to vulnerable endpoint.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: class.upload 1.0.3 or 2.0.4

Vendor Advisory: https://github.com/verot/class.upload.php/commits/master

Restart Required: No

Instructions:

1. Update class.upload.php to version 1.0.3 or 2.0.4. 2. For Joomla! K2 extension, update to version containing commit d1344706c4b74c2ae7659b286b5a066117155124. 3. Replace vulnerable class.upload.php files with patched versions from official repository.

🔧 Temporary Workarounds

Block .phar file uploads

all

Add .phar to blocked extensions list in upload validation

Add '.phar' to $upload->file_safe_name array or equivalent extension blacklist

Disable file upload functionality

all

Temporarily disable file uploads until patched

Disable file upload forms or set upload_max_filesize=0 in php.ini

🧯 If You Can't Patch

  • Implement strict file type validation using MIME type checking, not just extensions
  • Store uploaded files outside web root with no execute permissions

🔍 How to Verify

Check if Vulnerable:

Check if class.upload.php version is <1.0.3 or 2.x <2.0.4. Look for .phar in blocked extensions list.

Check Version:

grep -i 'version' class.upload.php | head -5

Verify Fix Applied:

Verify class.upload.php version is 1.0.3+ or 2.0.4+. Confirm .phar is in blocked extensions list.

📡 Detection & Monitoring

Log Indicators:

  • File upload attempts with .phar extension
  • Unusual POST requests to upload endpoints
  • Execution of uploaded files from upload directories

Network Indicators:

  • POST requests with .phar files to upload endpoints
  • Subsequent connections from server to external IPs

SIEM Query:

source="web_logs" AND (uri_path="*upload*" OR uri_path="*k2*") AND (file_extension=".phar" OR user_agent="*curl*" OR user_agent="*wget*")

🔗 References

📤 Share & Export