draft preview · not published · notes marked "Before launch" will not appear on the live site

Home / Known exploited

CVE-2022-46169: Cacti Command Injection Vulnerability

Exploited in attacksPublic exploit code

Yes. CVE-2022-46169 has been used in real attacks. CISA added it to its Known Exploited Vulnerabilities catalog on 16 February 2023. Public exploit code is available: 1 Metasploit module, 1 Exploit-DB entry and a Nuclei detection template. EPSS puts the chance of further exploitation attempts in the next 30 days at 99.8%.

Exploited in real attacks
Yes. On CISA's exploited list since 16 February 2023
Used in ransomware
Not known
Public exploit code
1 Metasploit module, 1 Exploit-DB entry and a Nuclei detection template
Chance of exploitation (EPSS)
99.8% in the next 30 days, higher than 99.9% of scored vulnerabilities. Scored 5 December 2026
Severity (CVSS)
9.8 Critical (version 3.1)
Affects
Cacti Cacti
Type of flaw
Injection (CWE-74)
Published
5 December 2022
US federal patch deadline
9 March 2023

What it is

Cacti contains a command injection vulnerability that allows an unauthenticated user to execute code.

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 se

Description from the CVE record.

Is CVE-2022-46169 being exploited?

Yes. CISA lists a vulnerability as known exploited only when it has reliable evidence of exploitation in real attacks, and it added CVE-2022-46169 on 16 February 2023.

Public exploit code

These are public references that anyone, including an attacker, can find. Their existence lowers the skill needed to use the flaw.

Affected products

From the CVE record. Check the vendor advisory for the full list of fixed versions.

What to do

CISA's required action: Apply updates per vendor instructions.

Because this flaw has already been used in attacks, patching is only half the job. If an affected system was reachable while unpatched, check it for signs of compromise before trusting it again.

How to check whether you are exposed

  1. Find every copy. List each place Cacti runs, including test systems and anything set up outside IT.
  2. Compare versions. Match what you find against the affected versions in the vendor advisory.
  3. Check reachability. An affected system that faces the internet is urgent; one reachable only from inside still matters once an attacker has a foothold.
  4. Assume it has been scanned. A public Nuclei template exists for this flaw, so finding exposed systems across the internet is automated.

HackDrill

Find out whether this is reachable in your systems.

A version number tells you a system is affected. A hacking drill tells you whether an attacker can actually get in through a flaw like this one in Cacti. HackDrill's AI agents attack your product, infrastructure, network and cloud the way modern attackers do, and show you the real, exploitable gaps so you can fix them first.

Other tracked vulnerabilities in Cacti products

CVEWhat it affectsStatusEPSSPublished
CVE-2024-29895cactiPublic exploit98.8%13 May 2024
CVE-2023-39361cactiPublic exploit88.7%5 September 2023
CVE-2024-25641cactiPublic exploit86.5%13 May 2024
CVE-2023-39362cactiPublic exploit84.8%5 September 2023
CVE-2023-49085cactiPublic exploit74.5%22 December 2023

Sources

Machine-readable: /api/cve/CVE-2022-46169.json