CVE-2021-25294

9.8 CRITICAL

📋 TL;DR

CVE-2021-25294 is a critical remote code execution vulnerability in OpenCATS caused by unsafe deserialization of user input. Attackers can exploit this by sending specially crafted requests to the index.php endpoint, potentially gaining full control of affected systems. All OpenCATS users running vulnerable versions are affected.

💻 Affected Systems

Products:
  • OpenCATS
Versions: through 0.9.5-3
Operating Systems: All operating systems running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: All installations with the vulnerable code path are affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

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

🟠

Likely Case

Remote code execution leading to data theft, system takeover, and potential ransomware deployment on vulnerable OpenCATS instances.

🟢

If Mitigated

Limited impact with proper network segmentation, WAF rules blocking malicious payloads, and restricted user access preventing exploitation.

🌐 Internet-Facing: HIGH - Directly exploitable via HTTP requests without authentication, making internet-facing instances immediate targets.
🏢 Internal Only: HIGH - Even internal instances are vulnerable to insider threats or compromised internal systems.

🎯 Exploit Status

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

Exploit leverages PHP object injection via __destruct magic method in guzzlehttp, with public proof-of-concept available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.9.5-4 and later

Vendor Advisory: https://www.opencats.org/news/

Restart Required: No

Instructions:

1. Backup your OpenCATS installation and database. 2. Download the latest version from the official OpenCATS repository. 3. Replace vulnerable files with patched versions. 4. Verify the fix by checking that unserialize() calls are properly sanitized.

🔧 Temporary Workarounds

Input Validation Filter

all

Add input validation to filter malicious serialized data before processing

Modify lib/DataGrid.php to validate/sanitize the 'parametersactivity:ActivityDataGrid' parameter

WAF Rule Blocking

all

Implement web application firewall rules to block requests containing serialized PHP objects

Add WAF rule to block patterns like 'O:[0-9]+:"GuzzleHttp' in POST/GET parameters

🧯 If You Can't Patch

  • Implement strict network access controls to limit OpenCATS access to authorized users only
  • Deploy a web application firewall with rules specifically blocking PHP object injection payloads

🔍 How to Verify

Check if Vulnerable:

Check if your OpenCATS version is 0.9.5-3 or earlier by examining the version file or admin interface

Check Version:

grep -r 'version' /path/to/opencats/ or check admin dashboard

Verify Fix Applied:

Verify that the vulnerable unserialize() call in lib/DataGrid.php has been replaced with safe deserialization or removed

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to index.php?m=activity with serialized data
  • PHP errors related to unserialize() or GuzzleHttp

Network Indicators:

  • HTTP requests containing serialized PHP object patterns (O:8:"stdClass" or similar)
  • Unexpected outbound connections from OpenCATS server

SIEM Query:

source="web_logs" AND (uri="*index.php?m=activity*" AND (param="*O:[0-9]+:*" OR param="*GuzzleHttp*"))

🔗 References

📤 Share & Export