VYPR
Unrated severityNVD Advisory· Published Sep 5, 2023· Updated Feb 27, 2025

Authenticated command injection in SNMP options of a Device

CVE-2023-39362

Description

Cacti is an open source operational monitoring and fault management framework. In Cacti 1.2.24, under certain conditions, an authenticated privileged user, can use a malicious string in the SNMP options of a Device, performing command injection and obtaining remote code execution on the underlying server. The lib/snmp.php file has a set of functions, with similar behavior, that accept in input some variables and place them into an exec call without a proper escape or validation. This issue has been addressed in version 1.2.25. Users are advised to upgrade. There are no known workarounds for this vulnerability.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

13

Patches

Vulnerability mechanics

Root cause

"The SNMP community string is not properly escaped before being used in an exec call, allowing command injection."

Attack vector

An authenticated privileged user can exploit this vulnerability by providing a malicious string in the SNMP community string field when configuring a device. This string is then used in an `exec` call without sufficient sanitization, leading to command injection and potential remote code execution on the server. The vulnerability is triggered when the SNMP module for PHP is not installed, forcing Cacti to use binary execution methods [ref_id=1].

Affected code

The vulnerability resides in the `lib/snmp.php` file, specifically within functions like `cacti_snmp_get`, `cacti_snmp_get_raw`, and `cacti_snmp_walk`. These functions construct commands for execution using the `exec` function, incorporating user-supplied SNMP options without adequate validation or escaping [ref_id=1].

What the fix does

The patch addresses the vulnerability by ensuring that the SNMP community string is properly escaped before being passed to the `exec` function. This prevents malicious input from being interpreted as shell commands, thereby closing the command injection vector. Users are advised to upgrade to version 1.2.25 to benefit from this fix [ref_id=1].

Preconditions

  • authAttacker must be authenticated with privileges to manage Devices and/or Graphs.
  • configThe SNMP module for PHP must not be installed.
  • inputA device that supports SNMP must be configured.

Reproduction

- Go to "Console" > "Create" > "New Device". - Create a Device that supports SNMP version 1 or 2. - Ensure that the Device has Graphs with one or more templates of: - "Net-SNMP - Combined SCSI Disk Bytes" - "Net-SNMP - Combined SCSI Disk I/O" - In the "SNMP Options", for the "SNMP Community String" field, use a value like: `public\' ; touch /tmp/m3ssap0 ; \'`. - Click the "Create" button. - Check under `/tmp` the presence of the created file `/tmp/m3ssap0` [ref_id=1].

Generated on Jun 2, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.