CVE-2024-31443
📋 TL;DR
CVE-2024-31443 is a cross-site scripting (XSS) vulnerability in Cacti's data query functionality. Attackers can inject malicious scripts that execute in users' browsers when viewing certain pages. This affects all Cacti installations prior to version 1.2.27.
💻 Affected Systems
- Cacti
📦 What is this software?
Cacti by Cacti
Fedora by Fedoraproject
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal session cookies, perform actions as authenticated users, or redirect users to malicious sites, potentially leading to full account compromise.
Likely Case
Attackers inject malicious JavaScript to steal session cookies or credentials from authenticated users viewing vulnerable pages.
If Mitigated
With proper input validation and output encoding, the impact is limited to script execution in specific contexts with user interaction required.
🎯 Exploit Status
Exploitation requires authenticated access to the data query functionality. The vulnerability is in form_save() function in data_queries.php.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.2.27
Vendor Advisory: https://github.com/Cacti/cacti/security/advisories/GHSA-rqc8-78cm-85j3
Restart Required: No
Instructions:
1. Backup your Cacti installation and database. 2. Download Cacti 1.2.27 or later from the official repository. 3. Replace the existing installation with the patched version. 4. Verify the patch by checking the version in the Cacti interface.
🔧 Temporary Workarounds
Input Validation Enhancement
allImplement additional input validation for data query parameters
WAF Rule Implementation
allDeploy web application firewall rules to block XSS payloads in data query parameters
🧯 If You Can't Patch
- Restrict access to Cacti interface to trusted users only
- Implement Content Security Policy (CSP) headers to mitigate XSS impact
🔍 How to Verify
Check if Vulnerable:
Check Cacti version in the web interface under 'About' or run: grep '\$version' /path/to/cacti/include/global.php
Check Version:
grep "\$version" /path/to/cacti/include/global.php
Verify Fix Applied:
Verify version is 1.2.27 or higher and check that the commit f946fa537d19678f938ddbd784a10e3290d275cf is present
📡 Detection & Monitoring
Log Indicators:
- Unusual POST requests to data_queries.php with script-like content in parameters
- Multiple failed authentication attempts followed by successful login
Network Indicators:
- HTTP requests containing JavaScript payloads in query parameters
- Unexpected outbound connections from Cacti server
SIEM Query:
source="cacti_access.log" AND (uri_path="/data_queries.php" AND (param="script" OR param="javascript" OR param="onerror"))
🔗 References
- https://github.com/Cacti/cacti/commit/f946fa537d19678f938ddbd784a10e3290d275cf
- https://github.com/Cacti/cacti/security/advisories/GHSA-rqc8-78cm-85j3
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RBEOAFKRARQHTDIYSL723XAFJ2Q6624X/
- https://github.com/Cacti/cacti/commit/f946fa537d19678f938ddbd784a10e3290d275cf
- https://github.com/Cacti/cacti/security/advisories/GHSA-rqc8-78cm-85j3
- https://lists.debian.org/debian-lts-announce/2024/09/msg00027.html
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RBEOAFKRARQHTDIYSL723XAFJ2Q6624X/