Cacti, the free network monitoring tool, got a public zero-day exploit over Thanksgiving, and the fix landed two days later

By Lounes Hareb13 views
  • Security
  • Open Source
Cacti, the free network monitoring tool, got a public zero-day exploit over Thanksgiving, and the fix landed two days later

Cacti is a free, open-source tool that monitors servers, routers and switches and turns the numbers into graphs. On Thanksgiving Day, November 26, a researcher published a working exploit for it, with a write-up, a proof of concept and a demo video, without reporting the flaw to the Cacti team first. If you run Cacti, this one is worth a few minutes.

What the exploit does

The exploit, dubbed "4HTTP2SHELL", needs no login and no API key. According to BleepingComputer's report, it goes from a fresh, unauthenticated HTTP session to command execution on the server in four requests, against what the researcher calls the default guest surface. One condition: the Cacti guest account has to be enabled.

The mechanism, as analysed by security firm RavenAI, is a stored SQL injection. Weak validation lets a guest user save malicious SQL inside their graph display preferences. When Cacti later processes those preferences, the injected SQL runs and can modify the poller's configuration so it executes operating system commands. The researcher demonstrated root access, but watchTowr, another security firm, notes that the privileges you get depend on the account running Cacti's web server and poller, which in many deployments could be a low-privileged web server account rather than root.

Why it matters beyond one server: Cacti can store credentials and SNMP passphrases for the devices it monitors, so a compromised Cacti server can be a stepping stone to the rest of a network.

Versions and fix

The researcher tested the exploit against Cacti Core 1.2.31. Whether earlier versions are vulnerable is not established. BleepingComputer reported no known exploitation in attacks as of November 27.

On November 28, Cacti developer Sean Mancini confirmed to BleepingComputer that a fix had been merged into the Cacti 1.2.31 maintenance branch. The change prevents guest users from saving profile or graph display preferences and adds extra validation of graph settings; the corresponding commit is visible in the project's GitHub repository. Administrators on 1.2.31 can apply the patch manually, and the Cacti team recommends testing it in a lab before deploying to production.

Until patched, the advice reported is to disable the Cacti guest account, restrict the web interface to trusted networks, review poller configurations for unexpected commands, and check logs for warnings about non-numeric values in graph display settings.

One more thing

The same weekend, several further Cacti advisories appeared on the project's GitHub security page: an authenticated SQL injection rated high that can turn a normal user into an administrator, a pre-authentication open redirect, and a stored XSS, both rated medium. They are separate findings, but if you are patching anyway, they are worth a look.

Sources: BleepingComputer (November 27, updated November 28), the Cacti repository and its security advisories on GitHub, and the analyses by watchTowr and RavenAI cited there.

Cover: illustration made by Freewares.org.

Share this article