Cloudanix VulnDB

CVE-2024-31459

High · 8.0

CVSS

8.0

EPSS

2.7%

Published

May 14, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A monitoring tool allowed attackers who could also change its database to run their own programs on the server.

Chainable
Exploitation
Remote Authenticated
Attacker needs
High Privilege
Complexity
High
Impact
Full Compromise
Component
Application
Class
Path Traversal
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

File inclusion vulnerability in lib/plugin.php where api_plugin_hook() reads plugin_hooks and plugin_config tables and directly concatenates values into include paths, enabling arbitrary file inclusion when chained with SQL injection to achieve remote code execution.

Why it matters to the business

Successful exploitation grants attackers remote code execution on monitoring servers, risking loss of operational visibility, infrastructure compromise, and disruption of fault management capabilities.

How an attack unfolds

An attacker first leverages SQL injection to insert malicious entries into the plugin_hooks or plugin_config tables, then invokes api_plugin_hook() which constructs and includes attacker-controlled file paths, resulting in arbitrary code execution on the server.

How to fix it

Upgrade Cacti to version 1.2.27 or later by applying the patch from commit b577c294214b7e65a7273031ef8f0045d2a0c5af which sanitizes database values before path concatenation.

How to confirm the fix worked

Confirm deployment of version 1.2.27 or the referenced commit; inspect lib/plugin.php to ensure database reads are no longer directly used in file path construction for includes.

Typical attack path

  1. Locate exposed Cacti instance and identify database access via SQL injection
  2. Inject crafted data into plugin_hooks or plugin_config tables
  3. Trigger api_plugin_hook() function to force inclusion of the injected path
  4. Execute arbitrary code on the target server

How to detect it

Review database contents of plugin_hooks and plugin_config tables for unexpected file paths, examine web server and application logs for anomalous includes involving plugin.php, and search for post-exploitation artifacts such as unexpected processes or files loaded from unusual locations.

What your security team should do

  • Immediately upgrade all Cacti installations to the patched version
  • Audit plugin_hooks and plugin_config tables for unauthorized entries
  • Restrict database access and input validation for plugin-related queries
  • Monitor application logs for unexpected include operations

The record

Cacti provides an operational monitoring and fault management framework. Prior to version 1.2.27, there is a file inclusion issue in the `lib/plugin.php` file. Combined with SQL injection vulnerabilities, remote code execution can be implemented. There is a file inclusion issue with the `api_plugin_hook()` function in the `lib/plugin.php` file, which reads the plugin_hooks and plugin_config tables in database. The read data is directly used to concatenate the file path which is used for file inclusion. 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