A flaw that allows remote command execution has been disclosed in Cacti 1.2.31, the latest version of the widely used network monitoring tool. On 26 November a researcher published a technical write-up and a working exploit on GitHub without notifying the vendor first. The flaw goes by 4HTTP2SHELL or 4HTTP2ROOT. It has no CVE number yet, and there is no official fix.
The attack only works where the guest account is enabled. The guest user writes crafted text into a profile setting that should hold a number (preview_graphs_per_page). That value ends up in an SQL query on the graphs page and plants a command in the poller table, and when the real-time graph is opened, the server runs it. It takes just four HTTP requests. The command runs as the user that runs Cacti. Cacti servers usually hold SNMP community strings, SSH keys and logins for network devices, which makes such a server a convenient way into the internal network. No real attacks have been recorded so far.
Until a fix is out, turn off the guest account and make sure no user is set as the guest user under Authentication Settings. Opening graph_view.php in a private browser window should ask for a login. Keep the Cacti web interface off the internet and allow access only over a VPN or a management network. The web server and poller should not run as root. If something looks suspicious, check the poller_item table for unfamiliar commands and search the logs for "non-numeric value" warnings from graph_view.php. If there are signs of compromise, change the SNMP and SSH credentials stored on the server.
Sources: The Hacker News, Daily CyberSecurity








