Cacti's graph preview trust boundary let profile settings reach SQL
Cacti's November 29, 2026 advisory describes how an ordinary profile preference reached graph pagination and an unprepared SQL LIMIT clause. The fix shows why validation must follow stored data across request, session, database, and query boundaries.
Cacti's graph preview trust boundary let profile settings reach SQL
Cacti's graph preview page trusted a value that entered through a user's profile settings, then used that value to build a database LIMIT clause. That connection turned an ordinary authenticated account into a path toward database control and, through Cacti's existing administrative features, command execution on the server. Cacti's security advisory published on November 29, 2026 describes the issue as a high severity vulnerability affecting versions through 1.2.31, with fixes prepared for the 1.2.32 release (Cacti security advisory).
The important detail is not that one PHP string reached one SQL query. It is that the application had several individually plausible assumptions about a setting, a request filter, and a database helper. Those assumptions stopped agreeing about who was responsible for validation. The profile endpoint treated the setting as an opaque value. The graph page treated it as a numeric default. The query builder treated the resulting string as safe. The missing boundary was between those three decisions (Cacti security advisory).
This is a useful security story because the vulnerable input was not a password field, a plugin upload, or an administrator-only configuration page. It was a display preference, preview_graphs_per_page, stored through an AJAX profile action. A setting that controls how many graphs appear on a screen should never be able to change the grammar of a database query. In Cacti's affected code, it could (Cacti security advisory).
The path from a preference to a query
The vulnerable route begins at auth_profile.php?action=update_data. The endpoint accepted a setting name and a value, then passed the value to api_auth_update_user_setting(). That function checked whether the name existed in Cacti's $settings_user schema, but the affected path did not validate the submitted value against the schema before storing it in settings_user (Cacti security advisory).
That distinction matters. Checking the key answers, "Is this a setting Cacti knows about?" It does not answer, "Is this a valid value for this setting?" A request naming therefore reached the storage layer with a value that did not need to be a positive integer or even a number. The normal profile form had stronger behavior for some numeric settings, but the AJAX update path bypassed that protection ().
CVE-2026-99362 turns a small NFSv4.1 and NFSv4.2 reply-cache negotiation value into a kernel memory corruption boundary. Here is what the primary records show about scope, exploit evidence, patch status, and safe containment.
CVE-2026-138445 shows how Umami's Reports API let a client supplied filter prefix reach PostgreSQL query structure. The patch is a precise lesson in separating request data from SQL identifiers, and in verifying source revisions when a fix lands after the latest release.
The second step happens in graph preview handling. Cacti defines the graphs request variable with an integer filter and uses the saved preview_graphs_per_page setting as its default. The advisory identifies a gap in validate_store_request_vars(): when the request does not provide a value, the function places the configured default into the request without applying the filter that would have rejected a non-integer string (Cacti security advisory).
That creates a trust-boundary mismatch. The same value can be rejected when supplied directly in the request, yet accepted when it arrives indirectly from stored user state. Filtering the visible request is not enough when defaults, session values, database values, and restored preferences can enter the same execution path (Cacti security advisory).
The final step is in graph_view.php. The page calculates the SQL limit by multiplying the requested graph count by the page number and concatenating the result with the second limit value. Cacti then passes the resulting SQL text into the graph query path instead of binding the limit values as parameters (Cacti security advisory).
The advisory explains that PHP's numeric conversion can turn a crafted string into a usable arithmetic prefix while leaving the original string available when the concatenated limit is built. The resulting text reaches the query without a prepared statement protecting the limit expression. The database connection also retained driver behavior that allowed multiple statements, which is why the issue was more serious than a malformed pagination value (Cacti security advisory).
Illustration of the data path described in Cacti's advisory. It explains how a profile preference crossed storage, default handling, pagination, and SQL construction. It is not an exploit trace or a screenshot.
That sequence is the core of the vulnerability. The profile endpoint did not need to understand SQL. The graph page did not need to know that a profile setting had been edited. The database helper did not need to know where the limit came from. Each layer made a local assumption, and the attacker used the gap between those assumptions (Cacti security advisory).
Why ordinary user permissions were enough
The affected operation was not described as administrator-only. The advisory says an attacker needed a logged-in account with the permissions to view graphs and update their profile. Those permissions were part of Cacti's default Normal User role, and the advisory says no non-default configuration was required (Cacti security advisory).
That changes how administrators should think about exposure. An account does not need access to data collection commands, plugin management, or path configuration for an application-level SQL injection to become dangerous. The first privilege boundary is the database account used by the application. If the vulnerable query can write to that database, the attacker may be able to change the data that controls later authorization decisions (Cacti security advisory).
Cacti's advisory reports that the verified outcome was self-granting console realms, including full administrator access. It then describes command execution through intended administrative features such as data input methods, plugins, and path settings (Cacti security advisory). The advisory's wording establishes the impact claimed by the reporter and maintainer, but it does not mean every Cacti deployment has identical database privileges, enabled plugins, or operating system permissions (Cacti security advisory).
That distinction is important for incident response. The vulnerability creates a route to administrator takeover, but the blast radius after takeover depends on the account that Cacti uses for its database, the database server's network access, the web server's service account, enabled Cacti features, and operating system confinement. The patch closes the application path. It does not retroactively tell an operator whether an exposed installation was already modified (Cacti security advisory).
The public advisory also includes a self-contained timing proof of concept and reports a response delay when tested against 1.2.31 (Cacti security advisory). I am not reproducing or executing that script here. Its presence means defenders should treat the issue as reproducible from the published material, not as a theoretical code review finding. It also means exposed systems deserve log review and credential review alongside patching (Cacti security advisory).
The advisory credits @amdadulbari with privately reporting the vulnerability on November 19, 2026. It separately attributes a later public disclosure to a chain involving Guest access and realtime graph handling (Cacti security advisory). Those are different pieces of evidence. The profile-setting SQL injection is the issue discussed here. The additional Guest and realtime changes explain why the broader maintenance patch is larger than a one-line fix (Cacti security advisory).
What the maintenance patch changes
The 8910e2a patch for the 1.2.31 line makes the first boundary explicit. It requires POST for state-changing profile actions, checks whether the current account can save its own settings, validates setting values against the available form schema, and moves profile JavaScript updates from GET requests to POST requests with the CSRF token (Cacti 1.2.31 maintenance security patch; Cacti pull request 9013).
It also adds validation around graph pagination. The patch introduces a helper that accepts positive integer page and row values, falls back to safe defaults when stored values are invalid, and rejects page calculations that could overflow integer arithmetic. Graph preview and tree views normalize restored filters before using them for SQL, navigation, or JavaScript output (Cacti 1.2.31 maintenance security patch).
Those changes address more than the exact payload described in the advisory. They recognize that a stored value can be dangerous even after it has left the original request. Normalization at the point where the value is consumed reduces the chance that old rows, manually edited settings, or future code paths will reintroduce the same class of bug (Cacti security advisory).
The patch also tightens the setting update logic. For fields with a fixed set of choices, it checks that the submitted value belongs to the declared array. For checkboxes it accepts the expected representations. For numeric defaults it requires numeric input. The change is a schema-aware validation step, not a generic attempt to strip punctuation from a string (Cacti 1.2.31 maintenance security patch).
That is the right direction for configuration data. A numeric preference should be parsed as a number and stored in a numeric form, not stored as arbitrary text and interpreted later. If a setting is a member of an allowlist, the application should check membership. If a value has a maximum or minimum, the check should happen before storage and again before use (Cacti security advisory).
The 49fd19b patch extends the defense to the 1.2.x branch. It adds a dedicated user_setting_validation.php module, enforces CSRF-protected POST handling for update_data, rejects Guest account mutations, validates realtime graph access, constrains realtime intervals, validates the realtime session hash, and escapes the hash before using it in the poller command line (Cacti 1.2.x defense-in-depth security patch).
It also checks graph identifiers with is_graph_allowed() before running the realtime poller or reading a cached graph. That matters because access control has to cover both the action that creates data and the action that retrieves cached data. A cache file is not a permission boundary by itself (Cacti 1.2.x defense-in-depth security patch).
Illustration comparing the affected trust boundary with the layered checks added by Cacti's maintenance patches. The labels summarize verified code changes and are not evidence of a live deployment.
The two patches show a layered repair rather than a single input filter. The first patch closes the reported 1.2.31 path. The second adds guards around adjacent settings and realtime functionality. The advisory lists both commits as part of the remediation and says the fixes will be included in 1.2.32 (Cacti security advisory).
What operators should do now
The affected version range in the advisory is 1.2.31 and earlier. The advisory says the issue is patched on the 1.2.31, 1.2.x, and develop branches and is intended for 1.2.32 (Cacti security advisory). Operators should use the official maintenance patch or upgrade through the project's release process when the fixed release is available. Do not assume that a version string alone proves the patch is present if the installation is built from a branch, a distribution package, or local modifications (Cacti security advisory).
For an installation that cannot be patched immediately, the advisory recommends disabling Guest access, restricting the web interface behind a VPN or allowlist, and limiting untrusted users who have the Update Profile realm. It also recommends inspecting the settings_user table for non-numeric values in numeric preferences such as preview_graphs_per_page, treeview_graphs_per_page, realtime_interval, min_tree_width, max_tree_width, and page_refresh (Cacti security advisory).
Those workarounds reduce exposure but do not repair the vulnerable code. Disabling Guest blocks unauthenticated paths associated with the later public chain described in the advisory, but it does not make an authenticated Normal User safe against the profile-setting issue. Restricting access to the interface helps with reachability, but it does not remove malicious values that may already be stored (Cacti security advisory).
A practical response sequence starts with containment. Restrict access to the Cacti web interface, identify which accounts have both graph viewing and profile update permissions, and record the current Cacti, PHP, web server, database, and package versions. Then preserve relevant logs before making broad changes, because administrators may need to determine whether profile updates or unusual graph preview requests occurred during the exposure window (Cacti security advisory).
Next, inspect the application database for anomalous values in settings that should be numeric. The advisory names the important columns and settings, but a clean settings table does not prove that the system was not accessed. It only tells you that those particular rows do not currently show the pattern described by the disclosure (Cacti security advisory).
After applying the patch, rotate credentials that would have been reachable through the application or its database, especially if logs show suspicious requests or if the Cacti database account has broad privileges. Review Cacti users, realms, plugins, data input methods, path settings, scheduled tasks, and web server account activity. The need for those checks follows from the advisory's reported path from database write access to administrator takeover and command execution through intended features (Cacti security advisory).
Do not use the public proof of concept as a health check against a production system. The advisory already provides enough information to identify the vulnerable versions and the affected code path. Testing an owned staging copy may be appropriate under a separate change-control process, but the article's published script should not become a reason to send SQL statements to an exposed monitoring server (Cacti security advisory).
The engineering lesson is about data lifetime
The most reusable lesson is that validation has to follow data across its lifetime. Cacti's request filter was not useless. It was simply applied at the wrong boundary. It validated an explicitly supplied graphs value but did not validate the stored default that populated the same variable later (Cacti security advisory).
Applications with settings, sessions, caches, and background jobs have many versions of this problem. A field may be safe when it comes from a form and unsafe when restored from a database. A value may be safe in a display template and unsafe when reused in a query, shell command, file path, or JavaScript literal. The source of the value does not determine its safety. The sink and the expected type do (Cacti security advisory).
The patch's structure makes that visible. Cacti adds functions for validating a setting against its schema, sanitizing positive integers, constraining realtime intervals, and checking session hashes before shell use (Cacti 1.2.x defense-in-depth security patch). Those helpers do not merely remove suspicious characters. They define what valid data means for each use (Cacti security advisory).
The second lesson is to treat state-changing profile actions as state-changing operations. Moving updates from GET to POST and requiring CSRF checks is not what fixes the SQL injection, but it reduces accidental and cross-site state changes around the same endpoint (Cacti 1.2.31 maintenance security patch; Cacti 1.2.x defense-in-depth security patch). The patch also rejects Guest mutations, which addresses the unusual risk of a shared account whose settings could otherwise affect other visitors (Cacti 1.2.x defense-in-depth security patch).
The third lesson is to test the negative space between components. The advisory's chain crossed profile storage, default handling, pagination, SQL construction, database driver behavior, and authorization state (Cacti security advisory). A unit test for the profile handler could pass. A unit test for the graph filter could pass. A review that checks only each function in isolation could still miss the path created when the profile value becomes the graph default (Cacti security advisory).
Cacti's new tests in the patches are therefore worth reading as a design signal. They check invalid setting types, unsupported page sizes, bounded pagination, Guest account identification, realtime intervals, session hashes, and the presence of access checks in the relevant files (Cacti 1.2.31 maintenance security patch; Cacti 1.2.x defense-in-depth security patch). The tests do not prove that every deployment is safe, but they document the invariants that the repair is meant to preserve (Cacti security advisory).
A patch is necessary, but recovery is separate
As of November 29, 2026, the official advisory describes a patched branch and a forthcoming 1.2.32 release, not a claim that every installation has already upgraded (Cacti security advisory). That timing matters for defenders with mixed fleets. A source checkout may receive the commit before a packaged release. A container image may lag behind the upstream tag. A distribution package may backport the fix without changing the upstream version string (Cacti security advisory).
The operational question is not simply, "Did we install 1.2.32?" It is, "Does the running code contain the profile validation, POST and CSRF enforcement, pagination normalization, and realtime access checks represented by the relevant patches?" The official Cacti patches provide concrete file and function changes that can be matched against a build when version metadata is ambiguous (Cacti 1.2.31 maintenance security patch; Cacti 1.2.x defense-in-depth security patch).
The other question is whether the vulnerability was used before the patch. Cacti's disclosure demonstrates a path to database modification and administrative takeover, but it does not provide evidence that every exposed instance was exploited. An investigation should combine application logs, database audit records, web server logs, account changes, plugin and path changes, and host telemetry. The absence of a suspicious row today is not enough if an attacker could have changed it and then restored it (Cacti security advisory).
Cacti is a monitoring system, which can make a compromise unusually confusing. A monitoring server often has credentials, network visibility, plugins, scheduled pollers, and access to infrastructure that it does not itself own. That does not make every Cacti host a guaranteed pivot point, but it makes the application's trust relationships worth mapping during response (Cacti security advisory).
The fix is technically specific, but the failure mode is common. A preference became a request default. A request default reached a query builder. A query builder assumed its input had already been checked. Security boundaries are often lost in those transitions, not in the line where the final dangerous operation occurs (Cacti security advisory).