{"id":"CVE-2022-46169","published":"2022-12-05T21:15:10Z","modified":"2026-06-17T05:11:21Z","title":"Cacti Command Injection Vulnerability","vendor":"Cacti","product":"Cacti","tier":"core","eol":null,"description":{"text":"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`.\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.","provenance":"source","from":"NVD"},"summary":{"text":"Cacti, an open source monitoring and fault management platform, has a command injection flaw in its remote_agent.php component, where an authorization bypass lets requests be treated as coming from the server itself. An unauthenticated remote attacker, with network access and no user interaction, can exploit this by spoofing a forwarded-address header, then supplying an ID for a poller item that runs a PHP script action to inject operating system commands, provided such an item is configured on the instance (a condition commonly met through predefined device templates).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-29T13:44:43Z"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"NVD"},"epss":{"score":0.99826,"percentile":0.99961,"date":"2026-10-30","provenance":"source"},"kev":{"dateAdded":"2023-02-16","dueDate":"2023-03-09","ransomware":false,"requiredAction":"Apply updates per vendor instructions.","notes":"https://github.com/Cacti/cacti/security/advisories/GHSA-6p93-p743-35gf;  https://nvd.nist.gov/vuln/detail/CVE-2022-46169","provenance":"source"},"vulncheckKev":{"dateAdded":"2023-01-08","exploitedFirstSeen":"2023-01-08","ransomware":false,"evidence":[{"url":"https://www.linkedin.com/posts/the-shadowserver-foundation_unauthenticated-command-injection-activity-7017511524604764160-qaje/","date":"2023-01-08"},{"url":"https://www.bleepingcomputer.com/news/security/hackers-exploit-cacti-critical-bug-to-install-malware-open-reverse-shells/","date":"2023-01-15"},{"url":"https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json","date":"2023-02-16"},{"url":"https://www.fortinet.com/blog/threat-research/moobot-strikes-again-targeting-cacti-and-realtek-vulnerabilities","date":"2023-03-29"},{"url":"https://unit42.paloaltonetworks.com/network-security-trends-nov-jan/","date":"2023-05-02"},{"url":"https://information.rapid7.com/rs/411-NAK-970/images/Rapid7-2023-Mid-Year-Threat-Review.pdf","date":"2023-08-17"},{"url":"https://dashboard.shadowserver.org/statistics/honeypot/vulnerability/map/?day=2023-12-25&host_type=src&vulnerability=cve-2022-46169","date":"2023-12-25"},{"url":"https://dashboard.shadowserver.org/statistics/honeypot/vulnerability/map/?day=2024-01-22&host_type=src&vulnerability=cve-2022-46169","date":"2024-01-22"},{"url":"https://dashboard.shadowserver.org/statistics/honeypot/vulnerability/map/?day=2024-01-23&host_type=src&vulnerability=cve-2022-46169","date":"2024-01-23"},{"url":"https://dashboard.shadowserver.org/statistics/honeypot/vulnerability/map/?day=2024-01-24&host_type=src&vulnerability=cve-2022-46169","date":"2024-01-24"}],"evidenceTotal":475,"provenance":"source"},"exploited":true,"otx":{"pulseCount":50,"pulses":[{"name":"Actively_Exploited_Kev | Oct 29, 2026","url":"https://otx.alienvault.com/pulse/6ae20c1db17e7057ae7d9ad1","created":"2026-10-28"},{"name":"Actively_Exploited_Kev | Oct 28, 2026","url":"https://otx.alienvault.com/pulse/6ae0ba7e0e2a97ff7b218819","created":"2026-10-27"},{"name":"Actively_Exploited_Kev | Oct 27, 2026","url":"https://otx.alienvault.com/pulse/6adf68b85c3e852f3c111d18","created":"2026-10-26"},{"name":"Actively_Exploited_Kev | Oct 24, 2026","url":"https://otx.alienvault.com/pulse/6adb740e397c3ad4799aa4cd","created":"2026-10-23"},{"name":"Actively_Exploited_Kev | Oct 23, 2026","url":"https://otx.alienvault.com/pulse/6ada236fcfba2dfa730ea482","created":"2026-10-22"},{"name":"Actively_Exploited_Kev | Oct 22, 2026","url":"https://otx.alienvault.com/pulse/6ad8d33a077cbb5cab524d80","created":"2026-10-21"},{"name":"Actively_Exploited_Kev | Oct 21, 2026","url":"https://otx.alienvault.com/pulse/6ad78130c4d1ac2be83a8b6d","created":"2026-10-20"},{"name":"Actively_Exploited_Kev | Oct 20, 2026","url":"https://otx.alienvault.com/pulse/6ad62f63c24a405a3423cc13","created":"2026-10-19"},{"name":"Actively_Exploited_Kev | Oct 19, 2026","url":"https://otx.alienvault.com/pulse/6ad4dda174e5797d0bd238b7","created":"2026-10-18"},{"name":"Actively_Exploited_Kev | Oct 18, 2026","url":"https://otx.alienvault.com/pulse/6ad38c22e1848f8189d1c121","created":"2026-10-17"}],"provenance":"machine"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"},{"id":"CWE-863","name":"Incorrect Authorization"},{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"references":[{"url":"https://github.com/Cacti/cacti/commit/7f0e16312dd5ce20f93744ef8b9c3b0f1ece2216","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/Cacti/cacti/commit/a8d59e8fa5f0054aa9c6981b1cbe30ef0e2a0ec9","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/Cacti/cacti/commit/b43f13ae7f1e6bfe4e8e56a80a7cd867cf2db52b","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/Cacti/cacti/security/advisories/GHSA-6p93-p743-35gf","tags":["Exploit","Mitigation","Patch","Third Party Advisory"]},{"url":"https://github.com/Cacti/cacti/commit/7f0e16312dd5ce20f93744ef8b9c3b0f1ece2216","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/Cacti/cacti/commit/a8d59e8fa5f0054aa9c6981b1cbe30ef0e2a0ec9","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/Cacti/cacti/commit/b43f13ae7f1e6bfe4e8e56a80a7cd867cf2db52b","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/Cacti/cacti/security/advisories/GHSA-6p93-p743-35gf","tags":["Exploit","Mitigation","Patch","Third Party Advisory"]},{"url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2022-46169","tags":["US Government Resource"]}],"techniques":[{"id":"T1190","name":"Exploit Public-Facing Application","tactics":["initial-access"],"provenance":"ai","basis":"ai-mapping","bases":["ai-mapping"],"basisDetail":"claude-haiku-5-5: unauthenticated remote exploit of public-facing web application","mappingType":"exploitation_technique","evidence":[{"from":"description","quote":"a command injection vulnerability allows an unauthenticated user to execute arbitrary code on a server running Cacti","start":158,"end":274}],"model":"claude-haiku-5-5","confidence":"medium","confidenceNote":"AI-mapped from the description (quote-validated, not expert-reviewed)"},{"id":"T1059","name":"Command and Scripting Interpreter","tactics":["execution"],"provenance":"ai","basis":"ai-mapping","bases":["ai-mapping"],"basisDetail":"claude-haiku-5-5: arbitrary code execution via command injection","mappingType":"primary_impact","evidence":[{"from":"description","quote":"allows an unauthenticated user to execute arbitrary code on a server running Cacti","start":192,"end":274}],"model":"claude-haiku-5-5","confidence":"medium","confidenceNote":"AI-mapped from the description (quote-validated, not expert-reviewed)"}],"reports":[],"affected":[],"advisories":[],"euvd":{"id":"EUVD-2022-48996","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2022-48996","exploited":true,"exploitedSince":"2023-02-16","provenance":"source"},"exploits":[{"id":51166,"url":"https://www.exploit-db.com/exploits/51166","title":"Cacti v1.2.22 - Remote Command Execution (RCE)","type":"webapps","platform":"php","date":"2023-03-31","verified":false,"provenance":"source"}],"exploitSources":{"exploitdb":{"count":1,"earliest":"2023-03-31"},"pocGithub":{"count":29,"skipped":8,"earliest":"2022-12-07","earliestUrl":"https://github.com/imjdl/CVE-2022-46169","repos":[{"name":"0xf4n9x/CVE-2022-46169","url":"https://github.com/0xf4n9x/CVE-2022-46169","stars":47,"created":"2022-12-08"},{"name":"FredBrave/CVE-2022-46169-CACTI-1.2.22","url":"https://github.com/FredBrave/CVE-2022-46169-CACTI-1.2.22","stars":42,"created":"2023-05-01"},{"name":"sAsPeCt488/CVE-2022-46169","url":"https://github.com/sAsPeCt488/CVE-2022-46169","stars":29,"created":"2023-01-05"},{"name":"ariyaadinatha/cacti-cve-2022-46169-exploit","url":"https://github.com/ariyaadinatha/cacti-cve-2022-46169-exploit","stars":15,"created":"2023-03-11"},{"name":"c3rrberu5/CVE-2022-46169","url":"https://github.com/c3rrberu5/CVE-2022-46169","stars":9,"created":"2023-01-13"}]},"metasploit":[{"name":"Cacti 1.2.22 unauthenticated command injection","module":"exploit/linux/http/cacti_unauthenticated_cmd_injection","type":"exploit","disclosureDate":"2022-12-05","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/cacti_unauthenticated_cmd_injection.rb"}],"nuclei":[{"id":"CVE-2022-46169","name":"Cacti <=1.2.22 - Remote Command Injection","severity":"critical","path":"http/cves/2022/CVE-2022-46169.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2022/CVE-2022-46169.yaml"}],"first":{"date":"2022-12-05","source":"Metasploit","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/cacti_unauthenticated_cmd_injection.rb"},"provenance":"source"},"detections":{"cveRules":[{"title":"Potential CVE-2022-46169 Exploitation Attempt","id":"738cb115-881f-4df3-82cc-56ab02fc5192","level":"high","status":"test","path":"rules-emerging-threats/2022/Exploits/CVE-2022-46169/web_cve_2022_46169_cacti_exploitation_attempt.yml","url":"https://github.com/SigmaHQ/sigma/blob/master/rules-emerging-threats/2022/Exploits/CVE-2022-46169/web_cve_2022_46169_cacti_exploitation_attempt.yml","techniques":["T1190"]}]},"exploitRefs":["https://github.com/Cacti/cacti/security/advisories/GHSA-6p93-p743-35gf"],"flow":[{"stage":"exploitation","techniques":["T1190"],"provenance":"ai"},{"stage":"primary","techniques":["T1059"],"provenance":"ai"}],"timeline":[{"date":"2022-12-05","kind":"published","label":"Published (NVD)","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-46169","provenance":"source"},{"date":"2022-12-05","kind":"exploit-public","label":"First public exploit: Metasploit; later: PoC-in-GitHub 2022-12-07, Exploit-DB 2023-03-31","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/cacti_unauthenticated_cmd_injection.rb","provenance":"source"},{"date":"2023-01-08","kind":"exploited-reported","label":"Exploitation first reported (VulnCheck KEV evidence)","url":"https://www.linkedin.com/posts/the-shadowserver-foundation_unauthenticated-command-injection-activity-7017511524604764160-qaje/","provenance":"source"},{"date":"2023-02-16","kind":"kev","label":"Added to CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","provenance":"source"},{"date":"2023-02-16","kind":"euvd-exploited","label":"ENISA EUVD: exploited","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2022-48996","provenance":"source"}],"speed":{"daysToPublicExploit":0,"firstExploitFrom":"Metasploit","daysToKev":73},"priority":{"score":69.9,"factors":[{"name":"In a KEV catalog","points":35.0,"detail":"listed in CISA KEV and VulnCheck KEV"},{"name":"Recent KEV listing","points":0.0,"detail":"added 1392 days ago"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":19.99,"detail":"percentile 0.9996"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":5.0,"detail":"1 NVD reference tagged Exploit; 1 Exploit-DB entry; 29 PoC-in-GitHub repos; 1 Metasploit module; 1 nuclei template"},{"name":"Mentioned in OTX pulses","points":3.0,"detail":"50 pulses"},{"name":"CVSS severity","points":6.86,"detail":"base score 9.8"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]}}