RC RANDOM CHAOS

ek0ms savi0r chains Cacti guest access to unauthenticated RCE

An unauthenticated attacker can chain Cacti 1.2.31's guest account to remote code execution in four HTTP requests. No patch yet; disable the guest account.

· 3 min read
ek0ms savi0r chains Cacti guest access to unauthenticated RCE

A security researcher using the alias “ek0ms savi0r” published a proof-of-concept that runs from a fresh, unauthenticated HTTP session to command execution as the Cacti server user in four HTTP requests. No login, no API key, no phishing. The target is Cacti Core 1.2.31, the current release, running on an isolated host with the guest account enabled. There is no CVE yet; the PoC is tracked as 4HTTP2SHELL and 4HTTP2ROOT.

Cacti’s guest account gives read access to graphs without authentication, and that surface is the entire attack. The chain starts at auth_profile.php?action=update_data, which the guest can call to write the preview_graphs_per_page setting. That setting is meant to hold an integer controlling how many graphs appear per page in Preview Mode. Cacti never checks that the value is a number, so the guest stores arbitrary text in it.

The text is a SQL fragment, and it sits dormant until something reads it back. When the graph preview page graph_view.php loads with default filters, Cacti pulls that stored value into a query. This is the second-order injection: the payload is written in one request and executed in a later one. The researcher’s payload is an UPDATE against Cacti’s poller table, and it works because Cacti’s PHP PDO driver accepts stacked statements through the SQL LIMIT clause, letting an attacker append a full statement where only a number belongs.

The poller table is the target because Cacti’s poller reads command strings from the database and runs them. The final request hits graph_realtime.php from the same guest session, which reads the row the attacker just modified and passes it to PHP’s popen() with no allowlist and no sanitization. The command runs as the Cacti server user.

The researcher lists four failures behind the chain:

  • the guest can write a numeric setting as an arbitrary string
  • the stored default bypasses request validation on the way back out
  • Cacti’s PDO driver accepts stacked statements through the LIMIT clause
  • the poller executes a command string it read from the database

What the attacker reaches at the end is worth more than the monitoring host. watchTowr’s advisory notes that Cacti stores credentials and connection details for the routers, switches, servers, and other devices it polls. Code execution on the Cacti server hands over that inventory and a pivot into the rest of the network. The same write primitive also lets an attacker suppress alerts by editing rows in the poller table.

There is no patch. Disable the guest account and restrict access to the Cacti web interface so the guest surface is unreachable from untrusted networks. Review poller configuration entries for command values you did not put there, since anyone who already ran this leaves modified rows behind. Apply the fix once it ships.

Share

Keep Reading

Latest on the Wire

Full wire →

New signal daily · RSS

Stay in the loop

New writing delivered when it's ready. No schedule, no spam.