Image: Cacti
A high-severity security flaw has been uncovered in Cacti, the popular open-source network graphing solution. The vulnerability, tracked as CVE-2025-66399, exposes Cacti installations to Remote Code Execution (RCE), potentially allowing attackers to seize full control of the monitoring server.
The core of the problem lies in how Cacti handles the SNMP Community String—a credential used to query network devices. When an administrator or a user with device-edit permissions saves a device, the application fails to scrub the input for dangerous characters.
The advisory explicitly notes an “input-validation flaw in the SNMP device configuration functionality.” Specifically, the code responsible for validating the community string (snmp_community) is missing a critical filter. The regex used for sanitization “is intentionally left empty (“), disabling validation.”
This oversight means that “newline characters remain unmodified.”
Because the system doesn’t strip these characters, an attacker can inject malicious commands that the backend system interprets as separate instructions.
“An authenticated Cacti user can supply crafted SNMP community strings containing control characters (including newlines) that are accepted, stored verbatim in the database, and later embedded into backend SNMP operations.”
When Cacti attempts to poll the device using downstream tools (like snmpwalk or wrappers), the injected newline breaks the command structure. “In environments where downstream SNMP tooling or wrappers interpret newline-separated tokens as command boundaries, this can lead to unintended command execution with the privileges of the Cacti process.”
The advisory provides a clear example of how a “crafted multi-line community string” is stored. An attacker can inject a payload such as:
As a result, arbitrary commands may execute with the privileges of the Cacti process.
The consequences of this vulnerability are severe. Successful exploitation can lead to
- Unauthorized modification of monitoring data
- Execution of system-level commands
- Unauthorized file writes
- Potential full compromise of the Cacti server
The development team has released a patch to address this flaw. Administrators are urged to upgrade immediately to version 1.2.29.