DEV Community

Etairos.ai
Etairos.ai

Posted on Originally published at threat-intelligence.redeyesecurity.com

Cacti 4HTTP2SHELL: Four Guest HTTP Requests Lead to Remote Code Execution on Cacti 1.2.31

TL;DR

  • what: A researcher using the alias ek0ms savi0r published 4HTTP2SHELL / 4HTTP2ROOT, an exploit chain that takes an unauthenticated guest session in Cacti 1.2.31 to command execution through a second-order SQL injection and the realtime poller.
  • impact: An attacker gets code execution as the Cacti server user on a host that often stores credentials for routers, switches and servers, and can tamper with the poller to suppress alerts.
  • fix: The Cacti Group merged fixes for GHSA-5x85-g4vc-gq53 on the 1.2.31 maintenance, 1.2.x and develop branches (PRs #9013, #9014, #9015), with an official fix due in Cacti 1.2.32.
  • who: Any organization running Cacti 1.2.31 with the guest account enabled, especially instances where the web interface can be reached from untrusted networks.

A public exploit chain against Cacti 1.2.31, the current release of the open-source network monitoring platform, takes an unauthenticated HTTP session to command execution in four requests. No login, no API key, no phishing. The only precondition is an enabled guest account. The researcher behind it, who goes by ek0ms savi0r, tracks the chain as 4HTTP2SHELL and 4HTTP2ROOT. When it was disclosed it had no CVE identifier and no patched release. The Cacti Group has since merged fixes on all active branches under GitHub advisory GHSA-5x85-g4vc-gq53, and an official fix is expected in Cacti 1.2.32.

The host matters as much as the bug. A Cacti server usually stores SNMP credentials and connection details for routers, switches and servers across the environment. Code execution there gives an attacker a foothold and a map of the network in one step.

Who Is Exposed

Cacti has shipped with the guest account disabled by default since version 0.8.7. Exposure is limited to instances where an administrator turned guest access on, which is common on internal dashboards meant for read-only viewing by NOC staff, helpdesk teams or wall displays. Those are the instances where nobody expects a guest to be able to change anything.

  • Affected: Cacti Core 1.2.31 with the guest account enabled.
  • Not affected by default: installations where guest access was never enabled.
  • Highest risk: instances where the web interface can be reached from the internet or from broad internal segments without an extra authentication layer.

How the Four Requests Work

The chain abuses a user preference, a page that trusts that preference, and a poller that trusts the database.

  • Request 1: A fresh, unauthenticated session is established against the default guest surface.
  • Request 2: The guest session calls auth_profile.php?action=update_data and writes a non-numeric value into the preview_graphs_per_page setting. That setting controls how many graphs appear per page in Preview Mode and should only ever hold an integer. Cacti does not check that it does.
  • Request 3: The guest loads graph_view.php with default filters. The stored value lands in the SQL LIMIT clause, which turns it into a second-order SQL injection. The researcher's proof of concept uses an UPDATE statement to rewrite a row in Cacti's poller table.
  • Request 4: The same guest session calls graph_realtime.php, the realtime poller endpoint. It reads the modified poller row and passes it straight to PHP's popen() function, with no allowlist or sanitization. The command runs as the Cacti server user.

⚠️ Four failures, one shell — The researcher lists four separate failures: a guest can write a numeric setting as an arbitrary string, the stored default gets past request validation, Cacti's PHP PDO database driver accepts stacked statements through the SQL LIMIT clause, and the poller runs a command string stored in the database. Fixing any one of them breaks this chain. Because all four were present, a read-only guest feature became a remote code execution path.

Impact Beyond the Monitoring Server

Running commands as the Cacti service account exposes everything the application can reach: the database, stored device credentials, SNMP community strings and the network paths the poller uses to reach managed infrastructure. watchTowr noted in its advisory that because Cacti often stores credentials and connection details for routers, switches, servers and other devices, an attacker at this level gets a foothold that reaches far beyond the monitoring server itself.

The poller table is also an evasion tool. An attacker who can rewrite poller entries can change what Cacti collects and reports, which can suppress the alerts defenders would rely on to notice the intrusion. A compromised monitoring system can show a quiet network while the attacker moves through it.

Vendor Fix and Mitigations

Sean Mancini of the Cacti team confirmed that the Cacti Group merged fixes across all active branches for the publicly disclosed 4HTTP2ROOT / 4HTTP2SHELL chain. The fixes are tracked as pull request #9013 for the 1.2.31 maintenance branch, #9014 for the 1.2.x branch and #9015 for the develop / 1.3.0 branch. The official packaged fix is planned for Cacti 1.2.32. A second researcher, Md. Amdadul Bari Imad, a DevOps engineer based in Bangladesh, independently found and reported the SQL injection on November 19, 2026.

Until 1.2.32 is deployed, the Cacti team's published mitigations are:

  • Disable guest access by setting the Guest User option under Authentication settings to No User. The vendor says this immediately blocks unauthenticated exploitation.
  • Put the web interface behind a VPN, reverse-proxy authentication or an IP allowlist.
  • Limit untrusted accounts that hold Update Profile (realm 20) access until the instance is patched or upgraded.
  • Review the settings_user table for non-numeric values in numeric preferences: preview_graphs_per_page, treeview_graphs_per_page, realtime_interval, min_tree_width, max_tree_width and page_refresh.
  • Review poller configuration entries for unexpected command values.

Patching does not clean up a compromise — Applying the fix closes the injection path. It does not undo poller rows or user settings an attacker already changed, and it does not rotate device credentials that may have been read. Any instance that had guest access enabled and was reachable before the fix should be treated as possibly compromised until its poller and settings data have been checked.

RedEye Assessment

This one should be a priority even though guest access is off by default. A working public proof of concept that needs only four requests puts exploitation within reach of almost any attacker, and Cacti has been a repeated target in past exploitation campaigns. The instances at risk are the ones admins set up for convenience and rarely look at again. The monitoring tier is privileged infrastructure: it holds the keys to the network devices and shapes what defenders can see. A compromise there gives an attacker both reach and cover.

Detection should focus on the chain's footprint. That means guest sessions sending requests to auth_profile.php with update_data, guest requests to graph_realtime.php, non-numeric values in numeric user preferences, and child processes started by the web server or Cacti service account that do not match normal poller activity. RedEye can assess your monitoring infrastructure exposure, review Cacti and similar platforms for signs of tampering, and help confirm that fixes and mitigations are in place across your environment.


Originally published on RedEye Threat Intelligence.

Top comments (0)