Cloudanix VulnDB

CVE-2024-31460

Medium · 6.5

CVSS

6.5

EPSS

1.8%

Published

May 14, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in the Cacti monitoring tool lets attackers who already have limited access change database contents and potentially take over the server.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Low
Impact
Data Tampering
Component
Application
Class
SQL Injection
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Unsanitized input from automation_tree_rules.php is concatenated into an SQL statement inside create_all_header_nodes() in lib/api_automation.php, enabling SQL injection that can alter database contents and lead to arbitrary file read/write and remote code execution.

Why it matters to the business

Attackers can tamper with monitoring configuration and data, potentially leading to unauthorized system access, data exfiltration, or full server compromise that disrupts operational visibility and incident response.

How an attack unfolds

An authenticated attacker supplies crafted values that reach the vulnerable SQL concatenation; secondary injection modifies Cacti database entries; the attacker then leverages the altered data to read or write files on the server and ultimately achieve remote code execution.

How to fix it

Upgrade Cacti to version 1.2.27 or apply the patch at commit b577c294214b7e65a7273031ef8f0045d2a0c5af; restrict access to automation configuration endpoints and review database permissions for the Cacti service account.

How to confirm the fix worked

Confirm the installed version is 1.2.27 or later, review the patched api_automation.php file for the commit, and test that automation tree rule inputs no longer produce unexpected SQL behavior.

Typical attack path

  1. Identify reachable Cacti instance and obtain low-privileged credentials
  2. Submit malicious input through automation tree rule interfaces
  3. Trigger SQL injection via create_all_header_nodes path to modify database records
  4. Use modified records to perform file operations or write malicious content
  5. Execute arbitrary code on the underlying host

How to detect it

Search web-server and application logs for unusual requests to automation_tree_rules.php or api_automation.php containing SQL metacharacters; inspect database audit logs for unexpected inserts or updates to automation tree rules; look for new or modified files written by the Cacti process after suspicious activity.

What your security team should do

  • Immediately upgrade all Cacti instances to the fixed version
  • Audit and restrict network access to Cacti web interfaces
  • Monitor database for unexpected changes in automation-related tables
  • Review logs for anomalous SQL or file-write activity post-upgrade

The record

Cacti provides an operational monitoring and fault management framework. Prior to version 1.2.27, some of the data stored in `automation_tree_rules.php` is not thoroughly checked and is used to concatenate the SQL statement in `create_all_header_nodes()` function from `lib/api_automation.php` , finally resulting in SQL injection. Using SQL based secondary injection technology, attackers can modify the contents of the Cacti database, and based on the modified content, it may be possible to achieve further impact, such as arbitrary file reading, and even remote code execution through arbitrary file writing. Version 1.2.27 contains a patch for the issue.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 cacti 0 1.2.16+ds1-2+deb11u4
Debian:11 cacti 0 1.2.16+ds1-2+deb11u3
Debian:12 cacti 0 1.2.24+ds1-1+deb12u3
Debian:12 cacti 0 1.2.24+ds1-1+deb12u2
Debian:13 cacti 0 1.2.27+ds1-1
Debian:13 cacti 0 1.2.26+ds1-1
SUSE:Package Hub 12 cacti 0 1.2.27-bp155.2.9.1
SUSE:Package Hub 12 cacti-spine 0 1.2.27-bp155.2.9.1
SUSE:Package Hub 15 SP5 cacti 0 1.2.27-bp155.2.9.1
SUSE:Package Hub 15 SP5 cacti-spine 0 1.2.27-bp155.2.9.1
SUSE:Package Hub 15 SP6 cacti 0 1.2.27-bp156.2.3.1
SUSE:Package Hub 15 SP6 cacti-spine 0 1.2.27-bp156.2.3.1
Ubuntu:20.04:LTS cacti 0 No fix
Ubuntu:20.04:LTS cacti 0 1.2.10+ds1-1ubuntu1.1
Ubuntu:22.04:LTS cacti 0 No fix
Ubuntu:22.04:LTS cacti 0 1.2.19+ds1-2ubuntu1.1
Ubuntu:24.04:LTS cacti 0 No fix
Ubuntu:24.04:LTS cacti 0 1.2.26+ds1-1
Ubuntu:24.04:LTS cacti 0 1.2.26+ds1-1ubuntu0.1
Ubuntu:Pro:14.04:LTS cacti 0 No fix
Ubuntu:Pro:14.04:LTS cacti 0 0.8.8b+dfsg-5ubuntu0.2+esm2
Ubuntu:Pro:16.04:LTS cacti 0 No fix
Ubuntu:Pro:16.04:LTS cacti 0 0.8.8f+ds1-4ubuntu4.16.04.2+esm2
Ubuntu:Pro:18.04:LTS cacti 0 No fix
Ubuntu:Pro:18.04:LTS cacti 0 1.1.38+ds1-1ubuntu0.1~esm3
openSUSE:Leap 15.5 cacti 0 1.2.27-bp155.2.9.1
openSUSE:Leap 15.5 cacti-spine 0 1.2.27-bp155.2.9.1
openSUSE:Leap 15.6 cacti 0 1.2.27-bp156.2.3.1
openSUSE:Leap 15.6 cacti-spine 0 1.2.27-bp156.2.3.1
openSUSE:Tumbleweed cacti 0 1.2.27-1.1

Related vulnerabilities