Unauthenticated RCE in Cacti 1.2.31: Dissecting the 4HTTP2SHELL Zero-Day Chain
A four-step second-order SQL injection and command injection chain in Cacti 1.2.31 allows unauthenticated remote code execution via the guest user profile.
Published: 2026.11.29
Visit Official SiteZero credentials or API keys required
Unpatched baseline release
Complete infrastructure telemetry exposure
A zero-day exploit chain identified as 4HTTP2SHELL bypasses authentication in Cacti Core 1.2.31, executing arbitrary operating system commands as the web server user. The vulnerability requires no prior administrative privileges, API keys, or user interaction. Exploitation succeeds whenever an organization maintains the legacy guest account in an enabled state.
Network monitoring infrastructure represents a primary enterprise target because poller nodes store high-privilege credentials for routers, switches, and core firewalls. Gaining command execution on the Cacti host allows an adversary to pivot horizontally across internal network segments. Because no official vendor patch is available at disclosure, defensive engineering teams must immediately modify database permissions and deprovision public web interface exposure.
The 4-Request Exploitation Sequence: From Guest Profile to PHP popen() Execution
The 4HTTP2SHELL exploit vector connects two architectural defects: an unvalidated numeric setting in user profile management and unsanitized command execution inside Cacti’s real-time graphing utility. The entire attack sequence runs across four deterministic HTTP requests against standard endpoints.
End-to-end execution path from guest session to operating system shell
Adversary establishes a fresh unauthenticated session via the enabled guest account surface.
Sends arbitrary SQL strings into preview_graphs_per_page via auth_profile.php?action=update_data.
Loads graph_view.php with default filters, triggering an UPDATE query that rewrites the poller table.
Requests graph_realtime.php to trigger execution of the poisoned poller row as the web runtime user.
In the initial phase, the attacker initializes a clean session against the web root. If guest permissions are active, the endpoint auth_profile.php?action=update_data accepts updates to personal interface preferences. The application fails to validate the preview_graphs_per_page parameter, which is intended to store an integer defining how many graphs render on a page. The handler writes arbitrary string inputs directly into the user settings table without type casting or input sanitization.
The second stage weaponizes this stored input as a second-order SQL injection. When the client loads graph_view.php, the backend engine pulls the stored setting to construct dynamic queries. Because the injected string escapes its query context, the database executes an arbitrary UPDATE query supplied by the attacker. In the demonstrated proof-of-concept, this query modifies command entries inside Cacti’s internal poller table.
The final request calls graph_realtime.php. This component fetches active poller configurations to spawn external monitoring processes. The application passes the poisoned command string directly into PHP’s native popen() function without command whitelisting or argument escapes. The underlying operating system immediately executes the attacker’s payload under the permissions of the web service account (www-data or cacti).
Attack Surface Comparison and Lateral Movement Surface
Because network monitoring engines require broad infrastructure access to gather interface telemetry, a shell on Cacti delivers immediate lateral movement capabilities. The host configuration typically retains plain-text or reversibly encrypted SNMPv3 keys, TACACS+ secrets, and SSH service account credentials.
| Evaluation Vector | Default Hardened Cacti Setup | Vulnerable Guest-Enabled Configuration |
|---|---|---|
| Authentication Barrier | Strict SSO / Local RBAC Required | Guest Account Accessible (auth_profile.php) |
| Input Validation on Settings | Strict Integer Type Casting Required | String Injection into Numeric Fields Permitted |
| Database Execution Model | Parameterized Read Queries | Stored Second-Order SQL Execution on Poller Table |
| Realtime Poller Invocation | Static Executable Path Validation | Raw popen() Execution of Database Row Values |
| Lateral Blast Radius | Isolated to External Network Telemetry | Direct Extractive Pivot to Managed Core Switches |
| Time to Remote Shell | Blocked at Ingress Layer | Under 1.5 Seconds (4 HTTP Transactions) |
The real danger lies in alert suppression and lateral credential dumping. By altering rows in the poller table, an attacker can selectively disable health polling for compromised switches while harvesting authentication packets. Security operations centers relying on threshold alerts fail to detect anomalous traffic when the reporting node itself is compromised.
Structured sequence for halting exploitation and validating database integrity
Deactivate the guest account inside User Management to close the attack endpoint immediately.
Move all Cacti web interfaces behind private management VPNs or strict IP access control lists.
Audit the poller table for unauthorized commands, malformed binary paths, or unapproved records.
Immediate Mitigation Protocol: Guest Account Deprovisioning and Host Auditing
Engineering teams cannot wait for an upstream patch release to protect production infrastructure. Because exploitation hinges entirely on the guest account context, security teams must immediately enforce configuration hardening.
1. Primary Ingress Shutdown: Disable the Guest Account
Cacti disabled guest accounts by default starting in branch 0.8.7, but legacy upgrades, custom configurations, or read-only operational setups frequently re-enable this account.
- Log into the administrative console, navigate to Console > Configuration > Users, locate the
guestaccount, and toggle status to Disabled. - If web administrative access is degraded, execute an explicit database update directly against the backing MySQL or MariaDB instance:
UPDATE user_auth SET enabled = 'off' WHERE username = 'guest'; - Validate that anonymous requests against
/auth_profile.phpreturn HTTP 302 redirects to/index.phprather than processing session data.
2. Network Ingress Isolation and ACL Enforcement
Monitoring interfaces should never be exposed to public subnets or untrusted developer VLANs.
- Place the Cacti administration console behind a dedicated bastion host or Zero Trust Network Access (ZTNA) gateway.
- Enforce Web Application Firewall (WAF) inspection rules that block non-numeric payloads directed to the
preview_graphs_per_pageparameter withinauth_profile.php. - Restrict outbound egress traffic from the Cacti poller server. Blocking arbitrary outbound connections limits reverse shell establishment even if an adversary discovers an alternative injection path.
3. Poller Table Verification and Anomaly Auditing
Security analysts must audit backend database tables to verify whether an active intrusion has already written malicious commands into the poller configuration.
- Query the database to inspect all rows in the poller schedule:
SELECT * FROM poller;andSELECT * FROM poller_item WHERE command NOT LIKE '/usr/bin/php%'; - Inspect application access logs for sequential POST requests hitting
auth_profile.phpfollowed immediately by GET requests tograph_view.phpandgraph_realtime.phpfrom identical IP addresses. - Re-issue all SNMP community strings and switch management credentials stored within Cacti if unexpected system execution or table tampering is detected on the server host.