Cacti vulnerability turns guest access into server commands
A Cacti vulnerability in version 1.2.31 can let an attacker move from an unauthenticated web session to command execution on the monitoring server in four HTTP requests. Cacti is an open-source tool used to monitor networks. The zero-day, a security flaw with no available fix at the time described, has not been assigned a CVE identifier. The proof-of-concept exploit is being tracked as 4HTTP2SHELL and 4HTTP2ROOT.
The issue affects Cacti Core 1.2.31, described as the latest version, when the guest account is enabled. Guest access allows someone to use parts of the Cacti web interface without logging in. A researcher using the alias “ek0ms savi0r” said the attack needs no login, valid API key or phishing, only four requests against the default guest-access surface. Cacti has disabled the guest account by default since version 0.8.7, but installations where administrators enabled it remain exposed to this attack path.
The first step abuses a guest-accessible function, auth_profile.php?action=update_data, to place a non-numeric value into preview_graphs_per_page. This setting controls how many graphs Cacti displays on each page in Preview Mode. Instead of accepting only a number, the vulnerable process allows arbitrary SQL strings, meaning database commands written in the language used to store and retrieve information.
The stored value can then become a second-order SQL injection. This means harmful database input is saved first and executed later when another page uses it. When graph_view.php loads with its default filters, the crafted value can cause an arbitrary SQL query to run. The demonstrated query uses an UPDATE statement to alter a record in Cacti’s poller table. The poller is the component that performs scheduled monitoring tasks.
In the final stage, the same guest session calls graph_realtime.php, the real-time polling endpoint. That endpoint reads the altered database row and passes its contents to PHP’s popen() function, which starts a system command. The value is not checked against an allowlist, meaning a permitted set of expected commands, and it is not sanitised before being used. This creates remote code execution, or RCE, the ability to run commands on a computer from another system.
The researcher identified four separate failures that combine to make unauthenticated RCE possible. A guest user can write a setting intended to contain a number as an arbitrary string. The stored default value bypasses request validation. Cacti’s PHP PDO database driver, the software component that connects PHP to the database, accepts stacked statements through the SQL LIMIT clause. Finally, the poller executes a command string stored in the database.
A successful attack could compromise the Cacti server and give the attacker a foothold for reaching other systems on the network. Cacti may contain credentials and connection details for routers, switches, servers and other monitored devices. watchTowr said this level of command execution could therefore expose sensitive information beyond the monitoring server itself. The attacker could also modify the poller table to suppress monitoring alerts, potentially hiding activity or failures from administrators.
No fix is identified in the available information. Until one becomes available, administrators should disable the Cacti guest account and restrict access to the Cacti web interface. They should also inspect poller configuration entries for unexpected command values and apply the vendor’s fixes as soon as they are released. AEU-I offers security-first IT, infrastructure and consulting, which is relevant for organisations reviewing the security of systems such as network monitoring platforms.
The immediate priority is to determine whether guest access is enabled, limit who can reach the Cacti interface, and look for unexpected changes in poller commands. Because the exploit uses several linked weaknesses rather than a single dangerous request, leaving any exposed guest installation in place can preserve the attack path until a fix is available.