CVE-2026-39951: Cacti Stored SQL Injection in Reports Feature (v1.2.30 and Prior)
Cacti, a widely-used open-source tool for monitoring system performance and managing infrastructure faults, contains a stored SQL injection flaw in its Reports feature. An authenticated attacker can inject malicious SQL code through the graph_name_regexp parameter, which gets stored in the database and executed when accessed later. The vulnerability affects Cacti version 1.2.30 and earlier; it has been patched in version 1.2.31. The threat requires an existing user account to exploit, but once compromised, the attacker can read sensitive data, modify records, or degrade system availability.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.6 HIGH · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
- Weaknesses (CWE)
- CWE-89
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-25 / 2026-06-26
NVD description (verbatim)
Cacti is an open source performance and fault management framework. Versions 1.2.30 and prior have a Stored SQL Injection vulnerability through graph_name_regexp in the Reports feature. This issue has been fixed in version 1.2.31.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-39951 is a CWE-89 SQL injection vulnerability affecting Cacti's Reports feature. The flaw exists in improper sanitization of the graph_name_regexp parameter, allowing authenticated users to craft payloads that are stored and later executed in SQL queries. Unlike reflected injection, stored variants persist in the database and fire automatically when the affected data is retrieved, multiplying exposure across all users and increasing the severity. The vulnerability scores 7.6 (HIGH) under CVSS 3.1 with a vector of CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L—indicating network accessibility, low complexity, authenticated access requirement, and high confidentiality impact alongside some integrity and availability degradation.
Business impact
A compromised Cacti instance can leak performance metrics, user data, and infrastructure intelligence valuable to attackers planning lateral moves or targeted attacks. Report data modified via SQL injection could mask monitoring anomalies, delaying incident detection. For organizations relying on Cacti for SLA tracking or compliance reporting, injected data could invalidate audit trails and create regulatory exposure. Depending on database permissions and deployment, attackers might escalate beyond Cacti to the underlying database server.
Affected systems
Cacti version 1.2.30 and all prior releases are vulnerable. Version 1.2.31 and later contain the fix. Deployment scope varies widely—Cacti is popular in enterprises for SNMP-based infrastructure monitoring, as well as in smaller operations. Organizations should inventory all Cacti instances and verify their version against 1.2.31.
Exploitability
Exploitation requires prior authentication, reducing the immediate risk from anonymous attackers. However, many Cacti deployments use default or weak credentials, or run in trust-based networks where internal access is assumed safe. The attack surface is the Reports feature, accessible to any authenticated user. No unusual user interaction is required once the payload is injected—it executes server-side when the report is fetched. CVSS reflects this as 'PR:L' (low privilege required) and 'UI:N' (no user interaction needed). The vulnerability is not currently tracked on the CISA Known Exploited Vulnerabilities list.
Remediation
Upgrade Cacti to version 1.2.31 or later. This is the definitive fix. In the interim, restrict access to the Reports feature via firewall or application-level controls, and audit user accounts to revoke unnecessary report-creation privileges. Review recent report creation logs for suspicious graph_name_regexp values (look for SQL keywords, comment markers, or unusual syntax). If SQL injection is suspected, inspect the underlying database for unauthorized tables, data exfiltration, or schema changes.
Patch guidance
Download Cacti 1.2.31 from the official repository and follow the vendor's upgrade documentation. Test the patch in a staging environment first to ensure compatibility with your plugins, custom graphs, and monitoring workflows. During patching, Cacti monitoring will be briefly offline; schedule this during a maintenance window. Verify the upgrade by checking the version string in the Cacti console and confirming report functionality. After patching, review user permissions and disable unused report-generation accounts.
Detection guidance
Monitor Cacti application and database logs for SQL syntax errors, unusual query patterns, or slow queries triggered by report generation. Check for report names or graph filters containing SQL keywords (SELECT, UNION, DROP, EXEC, etc.) or comment sequences (--,/*,*/). Query the Cacti database directly for anomalous stored procedures or functions created after the last known maintenance window. Correlate Cacti activity with database access logs to identify reads or writes from unexpected sources. SIEM rules should flag report API calls followed by database errors or long query execution times.
Why prioritize this
Although exploitation requires authentication, the high CVSS score (7.6) reflects the serious confidentiality and integrity impact. Cacti is often deployed in sensitive network monitoring roles where data breaches and tampering carry significant operational and compliance consequences. The simplicity of the attack vector (network-accessible, low complexity) and the lack of active exploitation data should not lull teams into complacency—upgrading is straightforward and should be prioritized within two weeks, sooner if Cacti runs in high-trust or customer-facing environments.
Risk score, explained
A CVSS 3.1 score of 7.6 (HIGH) reflects the combination of network accessibility, straightforward exploitation technique, and severe impacts on data confidentiality (reading arbitrary database contents) and some degradation of integrity and availability. The requirement for prior authentication ('PR:L') prevents the score from reaching CRITICAL, but the absence of user interaction and the potential to affect all report consumers elevates the threat. Organizations with strong access controls and network segmentation may experience lower real-world risk; those with permissive internal networks face proportionally higher risk.
Frequently asked questions
Do we need to patch immediately if Cacti is only accessible on an internal network?
Yes. While network segmentation reduces external attack surface, insider threats, compromised internal accounts, and lateral movement from other breached systems remain valid attack vectors. Authentication is required but not a sufficient control; patch within your standard change management cycle, prioritized for this month.
Can we detect or block exploitation without patching?
Partially. Monitor for SQL injection patterns in the Reports feature (CWE-89 signatures), restrict graph_name_regexp input length, and rate-limit report generation API calls. However, these are mitigations, not prevention. A motivated attacker may bypass them; patching to 1.2.31 is the only reliable fix.
What if we're on version 1.2.29 or earlier—is the risk higher?
The vulnerability affects all versions 1.2.30 and prior equally. There is no graduated risk based on sub-version. Upgrade directly to 1.2.31.
Will patching break our existing reports?
Cacti patch releases are designed to be backward-compatible. Test in a staging environment first, but reports created in 1.2.30 should function in 1.2.31. Review any custom plugins or third-party extensions for compatibility.
This analysis is based on vulnerability data published as of 2026-06-25. Readers must verify all version numbers, patch availability, and compatibility information against official Cacti vendor advisories and security bulletins. SEC.co does not guarantee the completeness or currency of this intelligence and disclaims liability for patching failures or operational disruptions. Organizations should conduct their own risk assessment and testing before applying patches in production environments. Source: NVD (public-domain), retrieved 2026-08-02. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2016-20062HIGHSQL Injection in Simply Poll 1.4.1 WordPress Plugin - Unauthenticated Data Theft
- CVE-2016-20063HIGHSQL Injection in Single Personal Message 1.0.3 – Credential & Data Theft Risk
- CVE-2016-20065HIGHUnauthenticated SQL Injection in Product Catalog 8 WordPress Plugin
- CVE-2016-20068HIGHUnauthenticated SQL Injection in WordPress Booking Calendar Contact Form 1.0.23
- CVE-2016-20069HIGHUnauthenticated SQL Injection in WordPress Booking Calendar Contact Form 1.0.23
- CVE-2016-20071HIGHCritical SQL Injection in WordPress 404 Redirection Manager Plugin v1.0
- CVE-2016-20072HIGHBBS e-Franchise WordPress Plugin SQL Injection – Remote Data Exfiltration Risk
- CVE-2016-20073HIGHSQL Injection in Answer My Question 1.3 WordPress Plugin