{"answers":{"affected":"It affects 1 product.","exploited":"Yes. Attackers have exploited CVE-2022-46169 in the wild since at least 16 Feb 2023.","fix":"Apply the vendor's patch. US federal agencies must fix it by 9 Mar 2023.","what":"CVE-2022-46169 is a critical command injection vulnerability in Cacti Cacti, published on 5 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-46169 and fix it if it is affected.\n\nWhat it is: CVE-2022-46169 is a critical command injection vulnerability in Cacti Cacti, published on 5 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: Yes. Attackers have exploited CVE-2022-46169 in the wild since at least 16 Feb 2023.\n\nAffected product: Cacti Cacti. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-46169/ (Markdown: https://insights.sbomify.com/CVE-2022-46169/index.md)","id":"CVE-2022-46169","markdown":"https://insights.sbomify.com/CVE-2022-46169/index.md","name":"CVE-2022-46169","record":{"aliases":["DEBIAN-CVE-2022-46169","GHSA-6p93-p743-35gf","UBUNTU-CVE-2022-46169","USN-7226-1","openSUSE-SU-2023:0025-1","openSUSE-SU-2024:12593-1"],"analysis":{"component_type":"web_application","fix_type":"patch","impacts":["code_execution","security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"Cacti monitoring platform","requires_auth":"none","summary":"Unauthenticated attackers can execute arbitrary code on Cacti servers by bypassing authentication via HTTP headers and exploiting command injection in remote_agent.php.","user_interaction":"not_required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"cacti","vendor":"cacti"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-863","name":"Incorrect Authorization"},{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"},{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"description":"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: \u003cTARGETIP\u003e`. 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`.\n\nThis 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 attacker 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.","ecosystems":["SUSE:Package Hub 12","SUSE:Package Hub 15 SP4","openSUSE:Leap 15.4","openSUSE:Tumbleweed"],"exploits":{"exploitdb":1,"first_seen":"2022-12-05","github_poc":37,"max_poc_stars":47,"metasploit":1,"nuclei":1,"refs":[{"date":"2022-12-08T01:52:13Z","kind":"github_poc","ref":"https://github.com/0xf4n9x/CVE-2022-46169","stars":47,"title":"CVE-2022-46169 Cacti remote_agent.php Unauthenticated Command Injection."},{"date":"2023-05-01T20:00:23Z","kind":"github_poc","ref":"https://github.com/FredBrave/CVE-2022-46169-CACTI-1.2.22","stars":42,"title":"This is a exploit of CVE-2022-46169 to cacti 1.2.22. This exploit allows through an RCE to obtain a reverse shell on your computer."},{"date":"2023-01-05T16:56:06Z","kind":"github_poc","ref":"https://github.com/sAsPeCt488/CVE-2022-46169","stars":29,"title":"PoC for CVE-2022-46169 - Unauthenticated RCE on Cacti \u003c= 1.2.22"},{"date":"2023-03-11T19:39:44Z","kind":"github_poc","ref":"https://github.com/ariyaadinatha/cacti-cve-2022-46169-exploit","stars":15,"title":"This is poc of CVE-2022-46169 authentication bypass and remote code execution"},{"date":"2023-01-13T05:37:56Z","kind":"github_poc","ref":"https://github.com/c3rrberu5/CVE-2022-46169","stars":9,"title":"Exploit to CVE-2022-46169 vulnerability"},{"date":"2023-01-02T18:03:26Z","kind":"github_poc","ref":"https://github.com/sh4den/CVE-2022-46169","stars":3,"title":"Cacti Unauthenticated Command Injection"},{"date":"2023-01-16T10:21:26Z","kind":"github_poc","ref":"https://github.com/N1arut/CVE-2022-46169_POC","stars":3,"title":"RCE POC for CVE-2022-46169"},{"date":"2023-04-13T08:55:08Z","kind":"github_poc","ref":"https://github.com/icebreack/CVE-2022-46169","stars":3,"title":"Fixed exploit for CVE-2022-46169 (originally from https://www.exploit-db.com/exploits/51166)"}],"tier":"exploited"},"has_fix":true,"headline":"Cacti Command Injection","id":"CVE-2022-46169","indexable":true,"kev":{"dateAdded":"2023-02-16","dueDate":"2023-03-09","knownRansomwareCampaignUse":"Unknown","product":"Cacti","requiredAction":"Apply updates per vendor instructions.","vendorProject":"Cacti","vulnerabilityName":"Cacti Command Injection Vulnerability"},"kind":"cve","links":{"ecosystem":null,"product":"cacti:cacti","products":["cacti:cacti"],"type":"command_injection","year":"2022"},"n_packages":7,"n_references":4,"next":{"headline":"CodeIgniter is vulnerable to improper authentication via Session Handlers","id":"CVE-2022-46170"},"packages":[{"ecosystem":"SUSE:Package Hub 12","fixed":["1.2.23-bp154.2.6.1"],"introduced":["0"],"last_affected":[],"package":"cacti","purl":"pkg:rpm/suse/cacti\u0026distro=SUSE%20Package%20Hub%2012","source":"openSUSE-SU-2023:0025-1"},{"ecosystem":"SUSE:Package Hub 12","fixed":["1.2.23-bp154.2.6.1"],"introduced":["0"],"last_affected":[],"package":"cacti-spine","purl":"pkg:rpm/suse/cacti-spine\u0026distro=SUSE%20Package%20Hub%2012","source":"openSUSE-SU-2023:0025-1"},{"ecosystem":"SUSE:Package Hub 15 SP4","fixed":["1.2.23-bp154.2.6.1"],"introduced":["0"],"last_affected":[],"package":"cacti","purl":"pkg:rpm/suse/cacti\u0026distro=SUSE%20Package%20Hub%2015%20SP4","source":"openSUSE-SU-2023:0025-1"},{"ecosystem":"SUSE:Package Hub 15 SP4","fixed":["1.2.23-bp154.2.6.1"],"introduced":["0"],"last_affected":[],"package":"cacti-spine","purl":"pkg:rpm/suse/cacti-spine\u0026distro=SUSE%20Package%20Hub%2015%20SP4","source":"openSUSE-SU-2023:0025-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["1.2.23-bp154.2.6.1"],"introduced":["0"],"last_affected":[],"package":"cacti","purl":"pkg:rpm/opensuse/cacti\u0026distro=openSUSE%20Leap%2015.4","source":"openSUSE-SU-2023:0025-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["1.2.23-bp154.2.6.1"],"introduced":["0"],"last_affected":[],"package":"cacti-spine","purl":"pkg:rpm/opensuse/cacti-spine\u0026distro=openSUSE%20Leap%2015.4","source":"openSUSE-SU-2023:0025-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["1.2.23-1.1"],"introduced":["0"],"last_affected":[],"package":"cacti","purl":"pkg:rpm/opensuse/cacti\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:12593-1"}],"prev":{"headline":"Group SMTP user emails are exposed in CC email header","id":"CVE-2022-46168"},"products":["cacti"],"published":"2022-12-05","related":[{"cvss_score":9.8,"headline":"Cacti: Pre-authentication SQL injection via rfilter RLIKE clause in graph_view.php","id":"CVE-2026-39893","kev_date_added":null,"published":"2026-06-24"},{"cvss_score":9.8,"headline":"Cacti: Unauthenticated RCE on Graph Image","id":"CVE-2026-39938","kev_date_added":null,"published":"2026-06-24"},{"cvss_score":9.8,"headline":"Cacti has Pre-Authentication SQL Injection via unanchored FILTER_VALIDATE_REGEXP in graph_view.php","id":"CVE-2026-39955","kev_date_added":null,"published":"2026-06-24"},{"cvss_score":9.8,"headline":"Unauthenticated SQL Injection in graph_view.php in Cacti","id":"CVE-2023-39361","kev_date_added":null,"published":"2023-09-05"},{"cvss_score":9.8,"headline":"Auth bypass in Cati","id":"CVE-2022-0730","kev_date_added":null,"published":"2022-03-03"},{"cvss_score":9.8,"headline":"Command injection in n/a","id":"CVE-2017-12065","kev_date_added":null,"published":"2017-08-01"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"open","licence":"CC0 1.0","name":"CISA KEV"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"active","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-10-21","vendors":["Cacti"]},"summary":"Unauthenticated attackers can execute arbitrary code on Cacti servers by bypassing authentication via HTTP headers and exploiting command injection in remote_agent.php.","url":"https://insights.sbomify.com/CVE-2022-46169/"}