Cloudanix VulnDB

CVE-2024-29894

Medium · 5.4

CVSS

5.4

EPSS

0.9%

Published

May 14, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in the Cacti monitoring tool could let someone trick the system into running unwanted commands as another user.

Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Data Tampering
Component
Application
Class
XSS
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Residual cross-site scripting flaw in raise_message_javascript allows JavaScript injection via unescaped single quotes in PHP variables $title and $header despite purify.js usage.

Why it matters to the business

Attackers can impersonate users to make unauthorized configuration changes in the monitoring system, potentially disrupting operations or altering visibility into infrastructure health.

How an attack unfolds

An attacker crafts input containing single quotes that reaches the message function, injects executable JavaScript, and executes actions under another authenticated user's session when the message is rendered.

How to fix it

Upgrade Cacti to version 1.2.27 or apply commit b577c294214b7e65a7273031ef8f0045d2a0c5af to ensure proper escaping of $title and $header.

How to confirm the fix worked

Confirm the fixed commit is present, test that single quotes in title or header no longer produce executable script, and verify the purify.js call plus additional escaping logic.

Typical attack path

  1. Identify an input vector that populates $title or $header without escaping
  2. Inject JavaScript payload using single quotes to break out of context
  3. Trigger rendering of the message via raise_message_javascript
  4. Execute actions on behalf of the victim user

How to detect it

Search web server and application logs for unusual single-quote sequences or script tags in parameters that feed into message functions; inspect rendered pages for unexpected inline scripts.

What your security team should do

  • Apply the fixed version or commit immediately across all instances
  • Review and sanitize all custom or third-party plugins that call raise_message_javascript
  • Monitor for any post-fix XSS attempts in application logs

The record

Cacti provides an operational monitoring and fault management framework. Versions of Cacti prior to 1.2.27 contain a residual cross-site scripting vulnerability caused by an incomplete fix for CVE-2023-50250. `raise_message_javascript` from `lib/functions.php` now uses purify.js to fix CVE-2023-50250 (among others). However, it still generates the code out of unescaped PHP variables `$title` and `$header`. If those variables contain single quotes, they can be used to inject JavaScript code. An attacker exploiting this vulnerability could execute actions on behalf of other users. This ability to impersonate users could lead to unauthorized changes to settings. Version 1.2.27 fixes this issue.

Affected packages

Ecosystem Package Introduced Fixed
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
Debian:14 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