CVE-2026-40078
NVD
Vulnerability Summary
Backend ORDER BY SQL Injection Affected Components Multiple files concatenate `sort_column` directly into ORDER BY clauses: - `lib/html_reports.php:2117, 2132, 2147, 2163` - `user_log.php:104` - `utilities.php:596` - `user_domains.php:620` - `user_group_admin.php:1887` Additionally, `get_order_string()` in `lib/html_utility.php` has a session cache bypass: the regex allowlist check executes AFTER the cached `$_SESSION['sort_string']` return, so poisoned session values bypass validation. Root Cause `sort_column` passes through `sanitize_search_string` which strips quotes and backticks but allows spaces, dots, and alphanumeric characters. The value is concatenated into `ORDER BY` without an allowlist check. Authentication Post-auth (all affected pages require authentication). PoC ``` GET /cacti/user_log.php?sort_column=1 UNION SELECT password FROM user_auth--&sort_direction=ASC ``` Fix 1. Move the regex allowlist check in `get_order_string()` BEFORE the session cache return 2. Add validation in `update_order_string()` before session write 3. Convert all direct `ORDER BY " . grv('sort_column')` sites to use `get_order_string()` Note PR #6955 partially addresses this but the session cache bypass and direct-concatenation sites remain. Fix Addressed in: https://github.com/Cacti/cacti/pull/7072 Fix Addressed in: https://github.com/Cacti/cacti/pull/7054 --- Fix: https://github.com/Cacti/cacti/commit/efa632f62 --- Maintainer Remediation & Release Information This vulnerability is fixed in Cacti 1.2.31 (`release/1.2.31`) via PR #7098 (and related hardening in #7054), which enforces per-page sort column allowlists on `ORDER BY` clauses. All affected endpoints require an authenticated Cacti session (`PR:L`). Users should upgrade to Cacti 1.2.31 or later.
CVSS v3.1 Base Metrics — Score 6.5
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:NAttack VectorNetwork
Attack ComplexityLow
Privileges RequiredLow
User InteractionNone
ScopeUnchanged
ConfidentialityHigh
IntegrityNone
AvailabilityNone
Affected & Patched Versions
- cacti/cacti <= 1.2.30
- cacti/cacti 1.2.31
What to do
Fix it during your normal patch cycle. No exploitation is confirmed yet.
- Check whether you run cacti/cacti and which version.
- Update to a patched version listed above, then confirm the new version.
Timeline
- Nov 29, 2026Published
- Nov 29, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new cacti/cacti CVEsYou are reading CVE-2026-40078. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
Data last checked: Nov 29, 2026 23:01 UTC