Summary
Cacti before version 1.2.31 contains an unauthenticated local file inclusion vulnerability tied to graph theme handling and rrdtool IPC serialization.
Under certain configurations, an attacker can craft requests that cause the server to read arbitrary local files, which may lead to code execution or data disclosure.
Affected context
The vulnerability occurs in Cacti deployments using versions 1.2.30 and earlier, particularly where graph themes and rrdtool inter-process communication (IPC) are enabled and exposed via the web interface.
It manifests when user-controlled input is used to resolve file paths for theme or IPC-related resources without sufficient normalization or restriction.
In environments where PHP interprets included files or where sensitive configuration files are accessible, this behavior can become significantly more dangerous.
Exploit preconditions
- Attack surface: HTTP(S) interface of the Cacti application.
- Required access: No authentication; an attacker only needs network access to the Cacti web UI.
- Trigger point: Requests that influence
graph_themeand related rrdtool IPC serialization parameters, causing the application to resolve and access local file paths. - Why exploitation is possible: Path parameters are not robustly validated or constrained, allowing traversal or arbitrary file selection, and IPC serialization hardening is insufficient to prevent misuse of filesystem access.
Why this happens
At its core, this issue reflects improper control of file paths derived from user input, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
The graph theme and rrdtool IPC mechanisms rely on dynamically computed file paths, but do not consistently normalize, validate, or restrict these paths to a safe directory set.
In some deployments, the included files or data read from disk may influence command execution paths or configuration parsing, intersecting with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where filesystem content or parameters can indirectly shape commands issued to rrdtool or related utilities.
Potential impact
- An attacker may read arbitrary local files accessible to the web server user.
- Sensitive configuration data, credentials, or keys could be exposed.
- Under certain configurations, file inclusion may lead to arbitrary code execution via interpreted PHP or script files.
- An attacker could potentially pivot to broader system compromise if included data is used to construct OS-level commands.
General mitigation guidance
Effective mitigation typically focuses on tightening path handling and reducing trust in user-controllable input.
Common defensive patterns include:
- Constraining file access to a strict set of directories and whitelisted resources for themes and IPC.
- Normalizing and validating all path-like inputs, rejecting traversal sequences and unexpected file extensions.
- Decoupling IPC and theme configuration from direct filesystem inclusion, favoring structured metadata rather than dynamic file loading.
- Ensuring any interaction with OS-level commands uses fixed command templates and parameter whitelisting to avoid injection via file content or user input.
- Running the application with least-privilege permissions so that, even if file read occurs, the accessible data set is minimized.
How teams detect issues like this
Organizations can detect similar vulnerabilities by:
- Applying static analysis rules that flag direct use of user input in file path construction or include/require statements.
- Reviewing code paths around graph theme selection and IPC handling for directory traversal, lack of whitelisting, or missing normalization.
- Implementing security-focused code review checklists that require verification of path constraints and command construction safety.
- Using web application firewalls or request filtering policies to log and alert on suspicious path patterns such as
../and unexpected file extensions.

