If you run Cacti, check two things today: whether guest access is switched on, and whether the new security patch is in place. The Cacti vulnerability nicknamed 4HTTP2ROOT is a zero-day remote code execution flaw: an attacker with no account can run commands on the server in four HTTP requests. A working exploit has been public since Thursday, and watchTowr reports attacks since November 27. A patch for version 1.2.31 landed on Saturday. A finished 1.2.32 release has not.
A monitoring server is not just another web app. Cacti holds SNMP communities, device logins and the addresses of routers, switches and servers across the network. Whoever owns it is well placed for the next hop.
How the Cacti vulnerability works
The chain starts with a dull feature. Every user can choose how many graphs the preview page shows. Cacti saves that preference through auth_profile.php?action=update_data, and that endpoint did no validation at all. Whatever you send ends up in the settings_user table as is.
The graph preview later reads the value back and pastes it into the LIMIT clause of a query that is not a prepared statement. According to GitHub advisory GHSA-5×85-g4vc-gq53, the integer filter meant to catch this never runs, because Cacti applies default values without filtering them. A stored preference of 10;DO SLEEP(4) turns into LIMIT 0,10;DO SLEEP(4). The PDO connection allows several statements per call, so the database runs the extra one too.
Once you can write to the database, the rest is legwork. An attacker can grant themselves admin rights or change settings that Cacti later hands to a shell. watchTowr describes exactly that for the public exploit: a poller setting is rewritten into a shell command, and a page that guests can reach then runs it. The 1.2.31 code shows how short that path is. graph_realtime.php allows guest access and calls shell_exec() on the PHP binary configured in path_php_binary. We have not reproduced the exploit, so we can’t confirm that this is the exact setting it uses.
Guest access vs. Normal User: who can attack
Much of the coverage blurs two separate things. The public exploit by the researcher ek0ms savi0r needs guest access. If a Guest User is set under Console, Configuration, Settings, Authentication, a fresh session with no login is enough. That is the variant being scanned for right now.
The underlying bug is wider. A researcher with the GitHub handle amdadulbari reported the SQL injection privately on November 19. The advisory lists the requirement as a logged-in user with View Graphs and Update Profile, realms 7 and 20. Both are part of the default Normal User set. Turning off the guest account stops the unauthenticated attack. It does not stop a colleague, customer or contractor with an ordinary Cacti login from making themselves an administrator. The advisory scores it 8.8 out of 10 on CVSS 3.1. No CVE has been assigned yet.
The advisory marks every version up to and including 1.2.31 as affected. The researcher tested against 1.2.31, the current release since mid-June. On the Cacti server, commands run with whatever account runs the web server or poller, which in most setups is not root.
Timeline from disclosure to patch
On November 26, ek0ms savi0r published a write-up, exploit and video on GitHub without telling the Cacti team first. By November 27 several copies had appeared on GitHub, one of them named as a mass exploitation tool. Previdian logged 22 injection attempts from a single IP against its honeypots that day but could not confirm successful command execution. watchTowr now lists the flaw as exploited in the wild.
The Cacti team moved fast. Pull request 9013 was merged into the 1.2.31 maintenance branch on November 28 at 00:24 UTC, followed by fixes for 1.2.x and the 1.3.0 development branch. The advisory went out on November 29 at 00:32 UTC. The flaw is not in CISA’s Known Exploited Vulnerabilities catalog yet. An older Cacti bug is: CVE-2022-46169, another unauthenticated command injection.
Patching Cacti 1.2.31 now
Start by checking the Cacti version. The path depends on how Cacti was installed. Debian and Ubuntu packages usually put it in /usr/share/cacti/site, manual installs often live in /var/www/html/cacti:
cat /usr/share/cacti/site/include/cacti_version
# or
cat /var/www/html/cacti/include/cacti_version
For 1.2.31 the project ships the fix as a patch file, which the maintainers say applies to the original 1.2.31 release tag. Back up code and database first. The Cacti team explicitly recommends trying it in a lab before production:
cd /tmp
curl -fsSLO https://github.com/Cacti/cacti/commit/8910e2aa42bf30d313bdce91c562cb377f3442eb.patch
cd /var/www/html/cacti
patch -p1 --dry-run < /tmp/8910e2aa42bf30d313bdce91c562cb377f3442eb.patch
patch -p1 < /tmp/8910e2aa42bf30d313bdce91c562cb377f3442eb.patch
The patch touches six PHP files. Guests can no longer save profile or graph preferences at all, since every visitor shares the same guest account. Values are now checked against the allowed options on save and normalized to integers again when read, which also covers bad values already sitting in the database. Profile changes now require a POST with a CSRF token.
Be careful with distribution packages. Their files may differ from upstream, and the next package update will overwrite local changes. On those systems the workaround matters most until the distribution ships a fix. Older installs should move to 1.2.31 first and then apply the patch. The advisory does not offer separate patches for older versions.
Workarounds if the patch has to wait
Guest access comes first. Under Console, Configuration, Settings, Authentication, set Guest User to “No User”. You can also check the database. The value can be a username or an ID, and 0 or empty means no guest:
SELECT name, value FROM settings WHERE name = 'guest_user';
Next, take the web interface off the open internet. Cacti belongs behind a VPN or an IP allowlist, and that was true before this week. Then review which accounts hold Update Profile and remove it from anyone you don’t fully trust. That slows down the authenticated path until the patch is in.
Looking for traces in the database and logs
Patching closes the hole. It does not undo anything an attacker already changed. The advisory names the preferences where tampered values can hide, and all six should contain nothing but 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]+$';
Treat every hit as suspicious. After that, look at everything Cacti executes: binary paths, Data Input Methods, and the accounts with Console Access (realm 8):
SELECT name, value FROM settings WHERE name LIKE 'path\_%';
SELECT id, name, input_string FROM data_input ORDER BY id;
SELECT u.id, u.username FROM user_auth u
JOIN user_auth_realm r ON r.user_id = u.id WHERE r.realm_id = 8;
A path_php_binary that doesn’t point at the PHP interpreter (usually /usr/bin/php), or that contains spaces and arguments, is a red flag. So are Data Input Methods nobody remembers creating and console users who shouldn’t be there. The last query ignores rights granted through user groups, so check those separately. watchTowr also says the chain leaves warnings about non-numeric values in the Cacti log:
grep -i "non-numeric" /var/www/html/cacti/log/cacti.log
If you find anything, treat the server as compromised. Resetting a few values is not enough at that point. Assume every SNMP community and device credential stored in Cacti is known to the attacker, and rotate them.
Our take
The Cacti developers handled this well: patches for three branches within two days of the public exploit, with tests and clear instructions. The awkward part is the missing 1.2.32 release. Scanners that only read the version number will report patched and unpatched boxes the same way. Being on the latest release does not mean you are safe here.
The bigger lesson is operational. An SQL injection in a profile field sounds like a bug for people who already have a login. Open guest access is what turns it into an internet-facing attack. We saw a similar pattern with the SQL injection in Craft CMS and with the WP Rocket vulnerability, where a public endpoint was the way in. Monitoring dashboards should not face the open internet. If all you need is to know whether services are up, you don’t need a dashboard full of device credentials. A lean uptime monitor like Checkmate does that job.
Our advice for today: switch off guest access, apply patch 8910e2a, run the queries above and put Cacti behind a VPN or allowlist. Upgrade normally once 1.2.32 ships.
Sources: Cacti advisory GHSA-5×85-g4vc-gq53, pull request 9013 with the 1.2.31 patch, watchTowr FAQ, Cacti 1.2.31 source code, Previdian honeypot report, CISA KEV catalog.


