9.8
CVSSv3

CVE-2022-46169

Published: 05/12/2022 Updated: 06/12/2022
CVSS v3 Base Score: 9.8 | Impact Score: 5.9 | Exploitability Score: 3.9

Vulnerability Summary

Cacti is an open source platform which provides a robust and extensible operational monitoring and fault management framework for users. In affected versions a command injection vulnerability allows an unauthenticated user to execute arbitrary code on a server running Cacti, if a specific data source was selected for any monitored device. The vulnerability resides in the `remote_agent.php` file. This file can be accessed without authentication. This function retrieves the IP address of the client via `get_client_addr` and resolves this IP address to the corresponding hostname via `gethostbyaddr`. After this, it is verified that an entry within the `poller` table exists, where the hostname corresponds to the resolved hostname. If such an entry was found, the function returns `true` and the client is authorized. This authorization can be bypassed due to the implementation of the `get_client_addr` function. The function is defined in the file `lib/functions.php` and checks serval `$_SERVER` variables to determine the IP address of the client. The variables beginning with `HTTP_` can be arbitrarily set by an attacker. Since there is a default entry in the `poller` table with the hostname of the server running Cacti, an attacker can bypass the authentication e.g. by providing the header `Forwarded-For: <TARGETIP>`. This way the function `get_client_addr` returns the IP address of the server running Cacti. The following call to `gethostbyaddr` will resolve this IP address to the hostname of the server, which will pass the `poller` hostname check because of the default entry. After the authorization of the `remote_agent.php` file is bypassed, an attacker can trigger different actions. One of these actions is called `polldata`. The called function `poll_for_data` retrieves a few request parameters and loads the corresponding `poller_item` entries from the database. If the `action` of a `poller_item` equals `POLLER_ACTION_SCRIPT_PHP`, the function `proc_open` is used to execute a PHP script. The attacker-controlled parameter `$poller_id` is retrieved via the function `get_nfilter_request_var`, which allows arbitrary strings. This variable is later inserted into the string passed to `proc_open`, which leads to a command injection vulnerability. By e.g. providing the `poller_id=;id` the `id` command is executed. In order to reach the vulnerable call, the attacker must provide a `host_id` and `local_data_id`, where the `action` of the corresponding `poller_item` is set to `POLLER_ACTION_SCRIPT_PHP`. Both of these ids (`host_id` and `local_data_id`) can easily be bruteforced. The only requirement is that a `poller_item` with an `POLLER_ACTION_SCRIPT_PHP` action exists. This is very likely on a productive instance because this action is added by some predefined templates like `Device - Uptime` or `Device - Polling Time`. This command injection vulnerability allows an unauthenticated user to execute arbitrary commands if a `poller_item` with the `action` type `POLLER_ACTION_SCRIPT_PHP` (`2`) is configured. The authorization bypass should be prevented by not allowing an malicious user to make `get_client_addr` (file `lib/functions.php`) return an arbitrary IP address. This could be done by not honoring the `HTTP_...` `$_SERVER` variables. If these should be kept for compatibility reasons it should at least be prevented to fake the IP address of the server running Cacti. This vulnerability has been addressed in both the 1.2.x and 1.3.x release branches with `1.2.23` being the first release containing the patch.

Most Upvoted Vulmon Research Post

There is no Researcher post for this vulnerability
Would you like to share something about it? Sign up now to share your knowledge with the community.

Vulnerability Trend

Vulnerable Product Search on Vulmon Subscribe to Product

cacti cacti

Vendor Advisories

Debian Bug report logs - #1025648 cacti: CVE-2022-46169: Unauthenticated Command Injection Package: src:cacti; Maintainer for src:cacti is Cacti Maintainer &lt;pkg-cacti-maint@listsaliothdebianorg&gt;; Reported by: Salvatore Bonaccorso &lt;carnil@debianorg&gt; Date: Tue, 6 Dec 2022 20:39:01 UTC Severity: grave Tags: securit ...
A flaw was found in how Cacti grants authorization based on IP address which allows authentication bypass, and possibly arbitrary command execution if a poller_item configured with a POLLER_ACTION_SCRIPT_PHP action is present This updated cacti package adds a feature allowing an administrator to explicitly list headers suitable for use in client a ...
Two security vulnerabilities have been discovered in Cacti, a web interface for graphing of monitoring systems, which could result in unauthenticated command injection or LDAP authentication bypass For the stable distribution (bullseye), these problems have been fixed in version 1216+ds1-2+deb11u1 We recommend that you upgrade your cacti packag ...

Mailing Lists

This Metasploit module exploits an unauthenticated command injection vulnerability in Cacti versions through 1222 in order to achieve unauthenticated remote code execution as the www-data user ...

Github Repositories

CVE-2022-46169 CVE-2022-46169 python CVE-2022-46169py taget_url

CVE-2022-46169 Cacti Blind Remote Code Execution (Pre-Auth) Disclaimer This is for educational purposes only I am not responsible for your actions Use at your own discretion Explanation This script bruteforces variables required to exploit this vulnerability This exploit requires the following 3 variables: Whitelisted IP address Correct host_id parameter Correct local_data

Cacti | Auth Bypass | RCE | CVE-2022-46169 Cacti: Unauthenticated Remote Code Execution Exploit in Ruby Cacti Docker This is a dockerized application that is vulnerable to the Cacti RCE vulnerability (CVE-2022-46169) Follow the link to get Cacti running githubcom/vulhub/vulhub/tree/master/cacti/CVE-2022-46169 Usage _____

CVE-2022-46169 This repository contains a Proof of Concept for CVE-2022-46169 - Unauthenticated RCE on Cacti &lt;= 1222 by chaining an Authentication Bypass and a Command Injection, described by Sonar in this blog post The same vulnerabilities were also discovered by: Steven Seeley (mr_me) of Source Incite Usage: positional arguments: target URL of the

burp-rs //debug version, a lots of changes may not Forward Compatible and lots of unwrap not handle burpsuite-like tools Because the burp extension is hard to debug, so I write a burp-like tool How to use it Build and run git clone ${this} sudo apt install ruby cd burp-rs cargo build --release cp -r active/ target/release/ cp -r libruby/ target/release/ cd target/release /bur

CVE-2022-46169 unauthenticated remote code execution Description Authentication Bypass: a hostname-based authorization check is not implemented safely for most installations of Cacti Command Injection: unsanitized user input is propagated to a string used to execute an external command POC Install Using go install go install githubcom/devAL3X/CVE-2022-46169_poc

CVE-2022-46169 CVE-2022-46169 Cacti remote_agentphp Unauthenticated Command Injection Auth Bypass Add X-Forwarded-For header to bypass authentication, note that its value is not a fixed value Brute Force Use Burp Intruder to fuzz test the values of host_id and local_data_ids RCE The point of command injection is the poller_id parameter GET /cacti/remote_agentphp?actio

CVE-2022-46169 (Cacti Command Injection) This repo is part of the hgrab-framework Affected product Cacti prior to v1222 Installation Install the app on the server user@domain:~# git clone githubcom/Inplex-sys/CVE-2022-46169git user@domain:~# cd /CVE-2022-46169/ user@domain:~# python3 mainpy &lt;listtxt&gt; &lt;command&gt;

Internet Camera Exploitation Tool This is a tool meant to assist cyber security researchers on discovering outdated and vulnerable camera systems on the internet by utilizing shodanio I was able to discover thousands of vulnerable cameras using it Vendors Affected [+] Hikvision [+] Avtech [+] TVT [+] Cacti more to come Features Fetching of hosts from shodanio Check for

CVE-2022-46169

Exploit For CVE-2022-46169 Getting Reverse Shell cacti_exploitpy &lt;URL&gt; &lt;LOCAL_MACHINE_IP&gt; &lt;LOCAL_PORT&gt;

CVE-2022-46169-PoC This repository contains a Proof of Concept for CVE-2022-46169 - Unauthenticated RCE on Cacti &lt;= 1222 disclosed by Sonar in this blog post Usage: positional arguments: target URL of the Cacti application optional arguments: -f FILE File containing the command -c CMD Command --n_host_ids

CVE-2022-46169 Repo for CVE-2022-46169

CVE-2022-46169 Cacti is an open source platform which provides a robust and extensible operational monitoring and fault management framework for users In affected versions a command injection vulnerability allows an unauthenticated user to execute arbitrary code on a server running Cacti, if a specific data source was selected for any monitored device The vulnerability reside

Wazuh_Cacti Sample logs to test wazuh detection on Cacti CVE-2022-46169

CVE-2022-46169 PoC: Authentication Bypass and Remote Code Execution This repository contains a PoC for the CVE-2022-46169 vulnerability, which allows an attacker to bypass authentication and execute arbitrary code remotely on the affected system This vulnerability affects Cacti, version 1222, released on August 18, 2022 The vulnerability occurs due to remote_agentphp has a

CVE-2022-4616 The webserver in Delta DX-3021 versions prior to 124 is vulnerable to command injection through the network diagnosis page This vulnerability could allow a remote unauthenticated user to add files, delete files, and change file permissions authentication complexity vector not available not available not available confidentiality integrity availabil