CVE-2024-29895
📋 TL;DR
CVE-2024-29895 is a critical command injection vulnerability in Cacti's 1.3.x DEV branch that allows unauthenticated attackers to execute arbitrary commands on the server. The vulnerability exists in cmd_realtime.php where user-controlled input from $_SERVER['argv'] is used in command execution when PHP's register_argc_argv option is enabled. This affects all systems running vulnerable Cacti versions with the default PHP configuration.
💻 Affected Systems
- Cacti
⚠️ 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.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise leading to data theft, ransomware deployment, lateral movement across the network, and persistent backdoor installation.
Likely Case
Remote code execution leading to web shell installation, credential harvesting, and initial foothold for further attacks.
If Mitigated
Limited impact if proper network segmentation and least privilege principles are implemented, though still significant risk.
🎯 Exploit Status
Simple command injection via URL parameters when register_argc_argv is enabled. Public advisory and code references available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Commit 53e8014d1f082034e0646edc6286cde3800c683d (note: this commit was reverted in 99633903cad0de5ace636249de16f77e57a3c8fc, so check current branch status)
Vendor Advisory: https://github.com/Cacti/cacti/security/advisories/GHSA-cr28-x256-xf5m
Restart Required: No
Instructions:
1. Update to latest Cacti version that includes the fix. 2. If using DEV branch, ensure you have commit 53e8014d1f082034e0646edc6286cde3800c683d applied. 3. Verify the patch is not reverted in your current version.
🔧 Temporary Workarounds
Disable register_argc_argv
allSet PHP's register_argc_argv option to Off to prevent URL parameter injection
php.ini: register_argc_argv = Off
Docker: Add '-d register_argc_argv=0' to PHP command
Network Access Control
linuxRestrict access to Cacti web interface to trusted networks only
iptables -A INPUT -p tcp --dport 80 -s TRUSTED_NETWORK -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -s TRUSTED_NETWORK -j ACCEPT
🧯 If You Can't Patch
- Immediately disable or block access to Cacti web interface
- Implement strict network segmentation and firewall rules to isolate Cacti servers
🔍 How to Verify
Check if Vulnerable:
Check if running Cacti 1.3.x DEV branch and PHP register_argc_argv is On. Review cmd_realtime.php line 119 for vulnerable code pattern.
Check Version:
php -r "include 'include/global.php'; echo CACTI_VERSION;" or check Cacti web interface About page
Verify Fix Applied:
Verify commit 53e8014d1f082034e0646edc6286cde3800c683d is present and not reverted. Test that $_SERVER['argv'] input is properly sanitized.
📡 Detection & Monitoring
Log Indicators:
- Unusual command execution in system logs
- Web server logs showing malicious parameters to cmd_realtime.php
- Unexpected process execution from web server user
Network Indicators:
- Unusual outbound connections from Cacti server
- Traffic to known malicious IPs or domains
SIEM Query:
source="web_server_logs" AND uri="*cmd_realtime.php*" AND (param="*;*" OR param="*|*" OR param="*`*" OR param="*$(*")
🔗 References
- https://github.com/Cacti/cacti/blob/501712998589763d411a68d35e3cda98fd9cfd18/cmd_realtime.php#L119
- https://github.com/Cacti/cacti/commit/53e8014d1f082034e0646edc6286cde3800c683d
- https://github.com/Cacti/cacti/commit/99633903cad0de5ace636249de16f77e57a3c8fc
- https://github.com/Cacti/cacti/security/advisories/GHSA-cr28-x256-xf5m
- https://github.com/Cacti/cacti/blob/501712998589763d411a68d35e3cda98fd9cfd18/cmd_realtime.php#L119
- https://github.com/Cacti/cacti/commit/53e8014d1f082034e0646edc6286cde3800c683d
- https://github.com/Cacti/cacti/commit/99633903cad0de5ace636249de16f77e57a3c8fc
- https://github.com/Cacti/cacti/security/advisories/GHSA-cr28-x256-xf5m