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 Site
Exploit Complexity
4 HTTP Requests

Zero credentials or API keys required

Affected Version
Cacti 1.2.31

Unpatched baseline release

Core Blast Radius
SNMP / SSH Pivot

Complete infrastructure telemetry exposure

Executive Takeaway ·Disabling guest accounts instantly neutralizes the unauthenticated attack surface, eliminating the execution path prior to upstream vendor patch releases.

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.

The 4HTTP2SHELL Zero-Day Exploit Sequence

End-to-end execution path from guest session to operating system shell

01 · Step 01
1. Guest Session Initiation

Adversary establishes a fresh unauthenticated session via the enabled guest account surface.

02 · Step 02
2. Setting Parameter Poisoning

Sends arbitrary SQL strings into preview_graphs_per_page via auth_profile.php?action=update_data.

03 · Step 03
3. Second-Order SQL Execution

Loads graph_view.php with default filters, triggering an UPDATE query that rewrites the poller table.

04 · Step 04
4. popen() Command Execution

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 VectorDefault Hardened Cacti SetupVulnerable Guest-Enabled Configuration
Authentication BarrierStrict SSO / Local RBAC RequiredGuest Account Accessible (auth_profile.php)
Input Validation on SettingsStrict Integer Type Casting RequiredString Injection into Numeric Fields Permitted
Database Execution ModelParameterized Read QueriesStored Second-Order SQL Execution on Poller Table
Realtime Poller InvocationStatic Executable Path ValidationRaw popen() Execution of Database Row Values
Lateral Blast RadiusIsolated to External Network TelemetryDirect Extractive Pivot to Managed Core Switches
Time to Remote ShellBlocked at Ingress LayerUnder 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.

Cacti Zero-Day Remediation and Triage Framework

Structured sequence for halting exploitation and validating database integrity

01 · Immediate Defense
Disable Guest Access

Deactivate the guest account inside User Management to close the attack endpoint immediately.

02 · Perimeter Isolation
Restrict Ingress Routing

Move all Cacti web interfaces behind private management VPNs or strict IP access control lists.

03 · Forensic Audit
Inspect Database Records

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 guest account, 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.php return HTTP 302 redirects to /index.php rather 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_page parameter within auth_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; and SELECT * FROM poller_item WHERE command NOT LIKE '/usr/bin/php%';
  • Inspect application access logs for sequential POST requests hitting auth_profile.php followed immediately by GET requests to graph_view.php and graph_realtime.php from 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.

Related Benchmark Reports

View All in Category →
Weekly Briefing

Weekly Tech & Business Data Briefing

Verified software analysis, practical gotchas, and essential supply-chain updates delivered weekly.

Unsubscribe with 1 click anytime. Zero spam.

* We may earn an affiliate commission from links in this report, at no extra cost to you and with zero impact on our benchmark data.