Cacti 4HTTP2SHELL: Lab Demonstration of Unauthenticated RCE on 1.2.31 with Guest Access Enabled
1. Basic Information Article Name: Authenticated SQL injection (stacked queries) via unvalidated profile setting reaching the graph preview LIMIT clause — any "Normal User" can become administrator Published By: Cac
1. Basic Information
- Article Name: Authenticated SQL injection (stacked queries) via unvalidated profile setting reaching the graph preview LIMIT clause — any "Normal User" can become administrator
- Published By: Cacti project
- Publication Date: 2026-11-29
- Source: Cacti project
- Related Sources: SecurityWeek: 4HTTP2SHELL Cacti Vulnerability Exploited in Attacks, watchTowr: 4HTTP2ROOT FAQ, Previdian: Cacti Zero-Day, Previdian: Cacti sensor activity
- Severity (Analyst Priority): high
- Official Severity: The Cacti GHSA evaluates the authenticated vector as CVSS v3.1 8.8 (High)
2. Executive Summary
In unpatched versions of Cacti 1.2.31 and earlier, an SQL injection via saved user settings allows standard users with graph viewing and profile update privileges to gain administrator privileges. In version 1.2.31 with guest access enabled, unauthenticated OS command execution was demonstrated in a test environment, and attempts targeting live environments were also observed.
3. Attack Flow
Both paths leverage the same SQL injection, differing in the privileges at connection and the path leading to OS command execution.
- Path A: Authenticated Standard User: Via an SQL injection in graph previews, a standard user with the necessary privileges can acquire Cacti administrator privileges and execute OS commands through management functions.
- Path B: 4HTTP2SHELL with Guest Enabled: In environments with guest access enabled, combining the same SQL injection with existing graph features can lead to OS command execution.
4. Attacker Position and Execution Location
- A remote attacker able to reach the Web UI in an environment with guest access enabled, or an attacker logged in as a standard user (Normal User) with graph viewing and profile update privileges.
- OS commands executed through this chain run on the Cacti host with the privileges of the web or poller process.
5. Perspective for Victims and Administrators
Victims
- Even if the monitoring interface appears to operate normally, settings and poller commands may be altered in the background.
Administrators
- Depending on log collection settings, brief web requests, warnings regarding non-numeric setting values, and changes to poller configurations can serve as clues.
6. Success and Failure Conditions
Success Conditions
- The presence of vulnerable processing in unpatched versions 1.2.31 and earlier.
- For Path A, being logged in and holding realm 7 (View Graphs) and realm 20 (Update Profile). For Path B, having guest access enabled and reachability to the Web UI (demonstrated against version 1.2.31).
- The ability to execute multiple SQL statements via the database connection. For OS command execution, access to path-specific Cacti features is required.
Failure Conditions and Countermeasures
- Apply the official maintenance patch published in the GHSA for version 1.2.31. The Cacti advisory says the fix will be included in version 1.2.32.
- Disabling guest access blocks Path B. Web UI reachability should also be restricted via VPN or allowlists.
- In unpatched systems, restrict granting realm 20 to untrusted users. Auditing user settings and poller configurations is effective for identifying modifications.
7. What Happens Upon Success
- Read and write access to the Cacti database using the application database user's privileges. Path A can potentially yield Cacti administrator privileges.
- Execution of OS commands under the privileges of the web or poller process.
- Compromise of the Cacti host could expose monitoring credentials and allow an attacker to use the host as a pivot into managed networks.
8. Observable Logs
- Web Access Logs / Reverse Proxy: For the guest path, a sequence of requests for guest usage, profile updates, graph previews, and real-time graphs are correlation candidates. Session identification depends on recorded fields.
- Endpoint / EDR: Shells spawned from web or poller processes, unknown commands, files, or network connections.
- Cacti / DB Audit: Check user settings, poller configurations, and user privilege changes through database audit logs or preserved configuration diffs.
- Network: Abnormal connections from the Cacti host to unknown destinations or managed devices.
9. Attack Success Determination
Attack Attempt Observed (Success Unconfirmed): Public Information: watchTowr captured exploitation activity on November 27, and Previdian observed SQL injection attempts in honeypots. Evidence from published attempts does not confirm successful execution in victim environments. Scope: Activity captured by watchTowr and attempts observed in Previdian honeypots.
Initial Execution Confirmed (Test Environment): Public Information: Previdian reported validating the public PoC on Cacti 1.2.31 with guest access enabled, reproducing command execution in a test environment. Scope: Test environment only.
10. Investigation Playbook
- Trigger: Guest usage, 4-request chain, non-numeric settings, poller command changes.
- Initial Check: Verify version, guest settings, web reachability, request timestamps, and settings_user values.
- Endpoint: Preserve web/poller processes, files, command history, and database diffs.
- Auth & Cloud: Check and rotate Cacti user realms, device credentials, and SNMP strings.
- Subsequent Activity: Track commands via the poller, connections to managed devices, and additional accounts.
- Containment: Disable guest access, block web access, apply patches, update credentials, and rebuild hosts if necessary.
- Decision Categories: Distinguish between attempts, SQL execution, realm acquisition, OS commands, and subsequent compromise.
11. Defense and Detection Ideas
- Single Event: Non-numeric values in numeric settings, profile updates from guest sessions.
- Time-Series Correlation: Correlate guest session -> profile update -> preview -> real-time graph.
- Hunting: Search for non-numeric setting values in settings_user, unexpected poller commands, and new realms.
- Log Gaps: Without reverse proxy and Cacti database audit logs, linking the four requests to configuration tampering is difficult.
- Priority Actions: Apply the released maintenance patch, disable guest access, and restrict Web UI reachability.
12. Facts / Inference / Hypothesis
Facts
- GHSA-5x85-g4vc-gq53 affects unpatched Cacti versions 1.2.31 and earlier. An official maintenance patch for 1.2.31 has been released, and fixes are scheduled for inclusion in 1.2.32. The official GHSA evaluates the authenticated path as CVSS v3.1 8.8 (High).
- Vulnerable processing in
auth_profile.phpsaves numeric settings without validation. Graph previews load saved values as defaults and concatenate them directly into the SQLLIMITclause without integer validation. - Standard users with realms 7 and 20 can execute stacked queries and proceed to OS command execution after obtaining console realms.
- Unauthenticated OS command execution via 4HTTP2SHELL was demonstrated in four HTTP requests within a test environment running Cacti 1.2.31 with guest access enabled.
- watchTowr captured exploitation activity on November 27. SecurityWeek reported on November 30 that Previdian observed approximately 1,800 attempts, and Previdian's sensor aggregation recorded 1,841 attempts on a single sensor between November 27 and 30.
- Guest access is disabled by default. OS commands run with the privileges of the executing process, and whether they run with root privileges depends on the execution environment.
Inference
- In environments where monitoring systems store network credentials, compromise of the Cacti host may be used as a pivot into managed networks.
Hypothesis
- None
13. MITRE ATT&CK Mapping
| ID | Technique | Confidence | Basis |
|---|---|---|---|
| T1190 | Exploit Public-Facing Application | high | Previdian validated unauthenticated initial execution on 1.2.31 with guest enabled. Successful compromise in live environments unconfirmed. |
| T1059.004 | Unix Shell | medium | Previdian validated OS command execution involving poller configuration tampering on 1.2.31 with guest enabled. |
| T1098 | Account Manipulation | high | Official GHSA states that standard users can assign themselves management console privileges via authenticated paths. |
14. Unknowns and Additional Investigation
- The number of successful exploitation attempts reaching OS command execution in live environments, the threat actors, and subsequent payloads remain unknown.
- The extent to which the entire attack chain for the guest path has been demonstrated on versions other than 1.2.31 is limited in public disclosures.
15. Impact on SOCs and Organizations
Organizations using Cacti as a monitoring infrastructure should disable guest access, restrict Web UI reachability, and apply the released maintenance patch to unpatched 1.2.31 instances. If operated in a vulnerable state, investigate user and poller configuration modifications, as well as file operations and communications by web and poller processes.
16. Summary by Role
- For SOCs: Correlate a sequence of requests to profile updates, graph previews, and real-time graphs with poller command changes.
- For Administrators: Disable guest access, restrict the Web UI to trusted networks, and apply the released maintenance patch.
- For Users: No remediation steps are required for general users. Report anomalies in management interfaces to administrators.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.