# Cacti Unauthenticated Remote Code Execution (4HTTP2SHELL / 4HTTP2ROOT) via preview_graphs_per_page Second-Order SQL Injection (No CVE Assigned)

> A public four-request exploit chain against Cacti 1.2.31 lets an unauthenticated guest session store a SQL fragment in the preview_graphs_per_page user setting, trigger stacked-query SQL injection that rewrites poller_item.arg1, and execute OS commands via the real-time graph poller. Exploitation requires the Guest account to be enabled; watchTowr reports in-the-wild exploitation, and fixes were merged upstream on 2026-11-28 but no packaged release (1.2.32 planned) had shipped as of the sources reviewed.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-01T09:01:14Z
- **Last updated:** 2026-12-01T09:01:14Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7151
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7151.png
- **ID:** TL-2026-7151
- **Severity:** CRITICAL (CVSS 9.8)
- **Category:** VULNERABILITY
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 12

## Description

4HTTP2SHELL (originally named 4HTTP2ROOT) is an unauthenticated remote code execution chain in Cacti Core 1.2.31, the open-source network monitoring and graphing platform. The PoC, write-up and video were published on GitHub on 2026-11-26 (Thanksgiving Day) by a researcher using the handle 'ek0ms savi0r' (reported as associated with 'Church of Malware'; repository 'Sad-Girls-0day-Club', path /4http2shell). A separate report of the issue to the Cacti project by Md. Amdadul Bari Imad on 2026-11-19 is cited in one write-up. No CVE had been assigned as of 2026-11-30. Severity scoring is inconsistent across sources: NSFOCUS CERT lists CVSS 9.8, GitHub advisory GHSA-5x85-g4vc-gq53 is reported at CVSS 8.8 (CWE-20, CWE-89), and watchTowr lists 0.0 (unscored). The 9.8 score and its standard CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) follow the NSFOCUS rating; the vector itself is not stated in the sources.

Exploit chain (per the technical write-ups): (1) the attacker obtains a guest session and CSRF token via GET auth_profile.php?tab=general&header=false; (2) POST auth_profile.php?tab=general&action=update_data with name=preview_graphs_per_page stores a SQL fragment in a setting that should hold an integer. The AJAX update path uses get_nfilter_request_var() with no filter and skips the is_view_allowed('graph_settings') check and the numeric reset in save_user_settings(); (3) GET graph_view.php?action=preview loads with default filters. The stored value becomes the default for 'graphs' and defaults bypass the FILTER_VALIDATE_INT filter in validate_store_request_vars(). graph_view.php builds the LIMIT clause by string concatenation (PHP arithmetic keeps leading digits, trailing text survives), and get_allowed_graphs() appends the limit unbound. Because PDO in lib/database.php does not disable emulated prepares or multi-statements, an appended stacked UPDATE poller_item statement executes (second-order stacked-query SQL injection); (4) GET graph_realtime.php?action=init&local_graph_id=... causes cmd_realtime.php to call exec_poll() on the rewritten poller_item.arg1, which lib/poller.php passes to popen(). Steps 3 and 4 return HTTP 200 with normal-looking output, producing little error signal. Commands run as the web server / poller account (typically www-data or apache); the demonstration reached root but this depends on deployment.

An authenticated variant is also described: the default 'Normal User' permission set includes realm 7 (View Graphs) and realm 20 (Update Profile), so any such user can escalate to administrator via the same path even when the guest account is disabled. The guest account has been disabled by default since Cacti 0.8.7, so exposure is limited to instances where an administrator enabled it.

Vendor response: Cacti developer Sean Mancini confirmed fixes merged on 2026-11-28 via PR #9013 (commit 8910e2a, 1.2.31 maintenance branch: blocks guest mutations, POST-only destructive actions, validates graph settings on write and read), PR #9014 (commit 49fd19b, 1.2.x: adds lib/user_setting_validation.php, csrf_require_post(), is_graph_allowed() before poller execution, realtime interval clamping) and PR #9015 (develop/1.3.0). An official packaged fix is planned for 1.2.32; the latest GitHub release remained 1.2.31 (2026-06-15). Patching closes the path but does not reverse poller_item or settings_user changes already made. Exploitation status: watchTowr reports capturing exploitation via its Attacker Eye on 2026-11-27 and updated its FAQ on 2026-11-29; BleepingComputer, as of 2026-11-27, reported none. It is not in CISA KEV per the sources reviewed, and no actor attribution or network IOCs have been published.

## MITRE ATT&CK

- T1190 Exploit Public-Facing Application
- T1078.001 Valid Accounts: Default Accounts
- T1078.001 Valid Accounts: Default Accounts
- T1059.004 Command and Scripting Interpreter: Unix Shell
- T1565.001 Data Manipulation: Stored Data Manipulation
- T1505.003 Server Software Component: Web Shell

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**Cacti 4HTTP2SHELL Four-Request Chain from a Single Client (Exploitation)** (`TL-2026-7151-SPL-001`)

Detects the 4HTTP2SHELL / 4HTTP2ROOT exploit chain against Cacti 1.2.31 (no CVE, GHSA-5x85-g4vc-gq53). One client issues a POST to auth_profile.php?action=update_data (stores the SQL fragment in preview_graphs_per_page), then graph_view.php?action=preview (stacked UPDATE poller_item), then graph_realtime.php?action=init (popen of the rewritten poller_item.arg1) within 120 seconds. Steps 3 and 4 return HTTP 200 with normal-looking output, so the request sequence is the most reliable web-log signal. Detects the sequence regardless of whether the session is the Guest account or an authenticated Normal User with realm 20.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1190, T1078.001
- **Data sources:** apache_access_log (index=web, sourcetype=access_combined), CommonSecurityLog (WAF/reverse proxy), webserver logsource
- **Severity:** critical
- **Confidence:** high

### Splunk SPL

```spl
index=web sourcetype=access_combined earliest=-24h (uri_path="*/auth_profile.php" OR uri_path="*/graph_view.php" OR uri_path="*/graph_realtime.php")
| eval step=case(method="POST" AND like(uri_path,"%/auth_profile.php") AND like(uri_query,"%action=update_data%"),"2_update_data", like(uri_path,"%/graph_view.php") AND like(uri_query,"%action=preview%"),"3_graph_preview", like(uri_path,"%/graph_realtime.php") AND like(uri_query,"%action=init%"),"4_realtime_init")
| where isnotnull(step)
| stats dc(step) as step_count values(step) as steps values(status) as statuses min(_time) as first_seen max(_time) as last_seen count by clientip host
| where step_count=3 AND (last_seen-first_seen)<=120
| eval first_seen=strftime(first_seen,"%F %T"), last_seen=strftime(last_seen,"%F %T")
| table first_seen last_seen clientip host steps statuses count
```

### Microsoft KQL

```kql
CommonSecurityLog
| where TimeGenerated > ago(24h)
| where RequestURL has_any ("auth_profile.php", "graph_view.php", "graph_realtime.php")
| extend Step = case(
    RequestMethod =~ "POST" and RequestURL contains "auth_profile.php" and RequestURL contains "action=update_data", "2_update_data",
    RequestURL contains "graph_view.php" and RequestURL contains "action=preview", "3_graph_preview",
    RequestURL contains "graph_realtime.php" and RequestURL contains "action=init", "4_realtime_init",
    "")
| where isnotempty(Step)
| summarize StepCount = dcount(Step), Steps = make_set(Step), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Requests = count() by SourceIP, DestinationHostName
| where StepCount == 3 and LastSeen - FirstSeen <= 2m
| project FirstSeen, LastSeen, SourceIP, DestinationHostName, Steps, Requests
```

### Sigma

```yaml
title: Cacti 4HTTP2SHELL Realtime Graph Init Request
id: 6f1c2a54-8d3b-4e7a-9b21-3c5d7e90a1b2
status: experimental
description: Detects requests to graph_realtime.php with action=init, the fourth request of the 4HTTP2SHELL chain, which makes cmd_realtime.php execute the possibly rewritten poller_item.arg1 through popen(). This is the stateless component of the chain; legitimate realtime graph use also matches, so correlate with a preceding auth_profile.php update_data POST from the same client (see the SPL and KQL forms).
references:
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://github.com/Cacti/cacti/security/advisories/GHSA-5x85-g4vc-gq53
author: Threadlinqs Team
date: 2026-12-01
tags:
    - attack.initial-access
    - attack.t1190
    - attack.execution
    - attack.t1059.004
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|endswith: '/graph_realtime.php'
        cs-uri-query|contains|all:
            - 'action=init'
            - 'local_graph_id='
    condition: selection
falsepositives:
    - Administrators and users legitimately opening realtime graphs
level: medium
```

**Known false positives:**

- A single user legitimately saving a profile and then viewing graphs and a realtime graph within two minutes (rare but possible for admins)
- Vulnerability scanners or synthetic monitoring that replay Cacti page flows

**Tuning notes:** Adjust index/sourcetype to your web log source (nginx users: sourcetype=nginx:plus:access or access_combined). Behind a load balancer use the X-Forwarded-For field instead of clientip. Exclude known scanner and monitoring IPs via a lookup. Widen the 120-second window to 300 if logs are batched. Cacti served from a sub-path is handled by the wildcard on uri_path.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- Cacti PHP Non-Numeric Warning in Graph Display Pages (4HTTP2SHELL Injection Side-Effect) (locked: unlock with TL Creds)
- Cacti Realtime Poller Spawning Shell With Attacker-Style Command (Post-Exploitation) (locked: unlock with TL Creds)
- New Outbound SSH or Telnet From a Cacti Host (Lateral Movement) (locked: unlock with TL Creds)
- Cacti Profile update_data POST from a Client With No Login (Guest-Session Exploitation) (locked: unlock with TL Creds)
- Executable Script Written to Cacti Web Root or cache/realtime by Web Service Account (Web Shell Persistence) (locked: unlock with TL Creds)
- Cacti Realtime Poller Directly Executing Download, Network or Recon Binary (4HTTP2SHELL Command Execution) (locked: unlock with TL Creds)
- Cacti poller_item.arg1 or preview_graphs_per_page Tampering in MySQL Query Log (locked: unlock with TL Creds)
- Cacti Web/Poller Account Outbound Connection From Shell or Download Tool (C2 / Tool Transfer) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sources

- [Cacti Remote Code Execution Vulnerability (4http2shell) Advisory - NSFOCUS](https://nsfocusglobal.com/cacti-remote-code-execution-vulnerability-4http2shell-advisory/)
- [4HTTP2ROOT Cacti Zero-Day FAQ - watchTowr](https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/)
- [Unpatched Cacti zero-day with public PoC gives remote code execution - BleepingComputer](https://www.bleepingcomputer.com/news/security/unpatched-cacti-zero-day-with-public-poc-gives-remote-code-execution/)
- [Cacti 4HTTP2SHELL: Four Guest HTTP Requests Lead to Remote Code Execution on Cacti 1.2.31 - DEV Community](https://dev.to/etairos/cacti-4http2shell-four-guest-http-requests-lead-to-remote-code-execution-on-cacti-1231-nl3)
- [Four Requests to a Shell: How a Cacti Guest Session Reached popen - DEV Community](https://dev.to/dohyeontech/four-requests-to-a-shell-how-a-cacti-guest-session-reached-popen-52ia)
- [Cacti 4HTTP2ROOT Zero-Day Enables RCE via Guest Access - Cyber Kendra](https://www.cyberkendra.com/2026/11/cacti-4http2root-zero-day-rce.html)
- [Cacti GitHub Security Advisory GHSA-5x85-g4vc-gq53](https://github.com/Cacti/cacti/security/advisories/GHSA-5x85-g4vc-gq53)
- [Cacti PR #9013 - 1.2.31 maintenance branch fix](https://github.com/Cacti/cacti/pull/9013)
- [Cacti download page](https://www.cacti.net/download_cacti.php)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7151
