HomeCyber AttacksUnpatched Cacti Zero-Day Lets Attackers Gain Remote Code Execution in Four Requests

Unpatched Cacti Zero-Day Lets Attackers Gain Remote Code Execution in Four Requests

A security researcher has published a working proof-of-concept exploit for an unpatched vulnerability in Cacti, the open-source network monitoring tool used by many organizations to track device performance over time. The researcher, who goes by the alias “ek0ms savi0r,” released the exploit chain, named 4HTTP2SHELL and 4HTTP2ROOT, in a public GitHub repository. No CVE identifier had been assigned to the flaw as of publication, and no patch is currently available.

What makes the finding notable is how little access an attacker needs to start with. According to the researcher’s writeup, the entire path from an anonymous, unauthenticated web session to running commands as the Cacti server’s own user takes just four HTTP requests. No login, valid API key, or phishing is required, as long as the installation has its built-in guest account enabled, which is the default configuration in the latest version, Cacti Core 1.2.31.

How four requests turn into server access

The chain starts with the guest account, which normally only lets a visitor view graphs. Through a page called auth_profile.php, a guest user can update a setting named “preview_graphs_per_page,” which is supposed to hold a number controlling how many graphs appear per page. Because Cacti does not check that the value submitted is actually a number, the researcher found that arbitrary text, including SQL code, can be written into that field instead.

That malicious value sits dormant until an administrator or another user simply loads the standard graph preview page with its default filters. At that point, the stored value is interpreted as part of a database query, a pattern known as a second-order SQL injection, because the injection happens when the earlier, separately submitted data is read back and used, not at the moment it was first entered. The injected SQL is an UPDATE statement that modifies a row in Cacti’s poller table, which the software uses to store commands for its monitoring processes.

The final step happens when Cacti’s realtime poller endpoint, graph_realtime.php, reads that same row back out of the database and passes its contents directly to PHP’s popen() function, which executes operating system commands, without sanitizing it first. At that point, whatever the attacker placed in the database runs as a real command on the server.

In its own advisory on the issue, security firm watchTowr pointed out that Cacti installations often store credentials and connection details for the network devices they monitor. That means an attacker who reaches this level of command execution on the Cacti server could potentially use it as a stepping stone into the wider network it was meant to be watching over, not just compromise the monitoring tool itself.

What administrators can do now

With no official patch yet released, the practical mitigation is to disable the guest account entirely, since the whole chain depends on it being active. Administrators are also advised to restrict network access to the Cacti web interface so it is not reachable from the open internet, and to review existing entries in the poller configuration for any command values that look unexpected or unfamiliar, since those could indicate the flaw has already been exploited.

Source: The Hacker News.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments