/

CVE-2026-39893

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Cacti rfilter Graph Endpoint

CVE-2026-39893

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Query Manipulation and Data Exposure

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical SQL injection flaw in Cacti occurs when the rfilter request parameter is directly concatenated into an SQL RLIKE clause without proper sanitization.

On instances where guest graph viewing is enabled, attackers can exploit this pre-authentication endpoint to manipulate backend queries and potentially access or alter monitoring data.

Affected context

The vulnerability arises in Cacti deployments up to version 1.2.30 that expose graph viewing functionality to unauthenticated users via a configured guest account.

In this context, the rfilter request variable is used to build an SQL RLIKE condition for filtering graph data, but the input is incorporated directly into the query string.

Environments that allow guest access and rely on the same database for broader monitoring or operational data are at higher risk, as the injection point sits in a commonly used viewing endpoint.

Exploit preconditions

  • Attack surface: Public or internal web interface for Cacti graph viewing.
  • Required access: Network-level access to the Cacti web UI; no login needed when guest viewing is enabled.
  • Trigger point: Submission of crafted rfilter values to the vulnerable endpoint during graph filtering or viewing.
  • Why exploitation is possible: The application uses unsanitized user input to build an SQL RLIKE clause, lacking parameterization or escaping, which allows user-controlled fragments to alter query structure.

Why this happens

This issue stems from constructing SQL statements by concatenating user-supplied data directly into a conditional clause, specifically an RLIKE predicate used for filtering graph data.

Because the rfilter parameter is not validated, normalized, or passed through a parameterized query mechanism, attackers can inject control characters and SQL syntax that change the query's logic.

Conceptually, this maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, where application logic treats externally controlled input as part of executable SQL rather than as data.

Potential impact

  • Attackers may read or infer sensitive monitoring or configuration data from the Cacti database.
  • Malicious queries could modify or delete records that underpin performance and fault monitoring.
  • SQL injection can be chained to escalate privileges within the application by manipulating user or role data.
  • In some deployment configurations, the database server itself may be further compromised via database-specific features.

General mitigation guidance

A robust mitigation strategy focuses on eliminating direct string concatenation for SQL commands and enforcing strict separation between query structure and user data.

Pattern-based improvements include adopting parameterized queries or prepared statements for all dynamic filters, constraining acceptable input for filter parameters to well-defined patterns, and centralizing query construction logic to avoid ad hoc SQL assembly.

Reducing the privileges of the application's database account and limiting accessible tables can further contain the impact of any residual injection flaws.

It is also advisable to review guest access configurations and ensure unauthenticated endpoints expose only minimal, non-sensitive functionality.

How teams detect issues like this

Detection typically starts with static analysis aimed at locating SQL queries built through string concatenation that incorporate request variables like $_GET or $_POST directly.

Code review should focus on endpoints that accept filter or search parameters, checking for parameterized query usage and proper input validation around regular-expression or pattern-based filters.

Security teams can enforce policies requiring prepared statements in database access layers and use automated scanning tools to probe for injection behavior on unauthenticated pages, particularly those related to reporting or graph viewing.

Sources

SourceLink
github.comgithub.com/Cacti/cacti/pull/7039
github.comgithub.com/Cacti/cacti/security/advisories/GHSA-69gg-mjfm-jjpc

Frequently asked

questions

Yes. When guest graph viewing is enabled, the affected endpoint can be reached by unauthenticated users, making the SQL injection fully pre-auth in that configuration.

An attacker needs only network access to the Cacti web interface and the ability to send crafted requests to the graph viewing endpoint; no prior application credentials are required where guest access is active.

The most robust fix is to replace all dynamic SQL construction involving user input with parameterized queries or prepared statements, and strictly validate filter inputs to only allow expected, well-formed patterns.

Establish a development practice that forbids direct concatenation of user input in SQL, implement centralized data-access layers that enforce parameterization, and complement these with regular secure code reviews and automated checks focused on query-building logic.

Find out what's already
exploitable in your codebase.