Vulnerabilities > CVE-2020-11108 - Unrestricted Upload of File with Dangerous Type vulnerability in Pi-Hole
Attack vector
NETWORK Attack complexity
LOW Privileges required
LOW Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
The Gravity updater in Pi-hole through 4.4 allows an authenticated adversary to upload arbitrary files. This can be abused for Remote Code Execution by writing to a PHP file in the web directory. (Also, it can be used in conjunction with the sudo rule for the www-data user to escalate privileges to root.) The code error is in gravity_DownloadBlocklistFromUrl in gravity.sh.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Accessing Functionality Not Properly Constrained by ACLs In applications, particularly web applications, access to functionality is mitigated by the authorization framework, whose job it is to map ACLs to elements of the application's functionality; particularly URL's for web apps. In the case that the administrator failed to specify an ACL for a particular element, an attacker may be able to access it with impunity. An attacker with the ability to access functionality not properly constrained by ACLs can obtain sensitive information and possibly compromise the entire application. Such an attacker can access resources that must be available only to users at a higher privilege level, can access management sections of the application or can run queries for data that he is otherwise not supposed to.
- Privilege Abuse An adversary is able to exploit features of the target that should be reserved for privileged users or administrators but are exposed to use by lower or non-privileged accounts. Access to sensitive information and functionality must be controlled to ensure that only authorized users are able to access these resources. If access control mechanisms are absent or misconfigured, a user may be able to access resources that are intended only for higher level users. An adversary may be able to exploit this to utilize a less trusted account to gain information and perform activities reserved for more trusted accounts. This attack differs from privilege escalation and other privilege stealing attacks in that the adversary never actually escalates their privileges but instead is able to use a lesser degree of privilege to access resources that should be (but are not) reserved for higher privilege accounts. Likewise, the adversary does not exploit trust or subvert systems - all control functionality is working as configured but the configuration does not adequately protect sensitive resources at an appropriate level.
Exploit-Db
id EDB-ID:48491 last seen 2020-05-19 modified 2020-05-19 published 2020-05-19 reporter Exploit-DB source https://www.exploit-db.com/download/48491 title Pi-Hole - heisenbergCompensator Blocklist OS Command Execution (Metasploit) id EDB-ID:48443 last seen 2020-05-11 modified 2020-05-10 published 2020-05-10 reporter Exploit-DB source https://www.exploit-db.com/download/48443 title Pi-hole < 4.4 - Remote Code Execution / Privileges Escalation id EDB-ID:48442 last seen 2020-05-11 modified 2020-05-10 published 2020-05-10 reporter Exploit-DB source https://www.exploit-db.com/download/48442 title Pi-hole < 4.4 - Remote Code Execution id EDB-ID:48519 last seen 2020-05-26 modified 2020-05-26 published 2020-05-26 reporter Exploit-DB source https://www.exploit-db.com/download/48519 title Pi-hole 4.4.0 - Remote Code Execution (Authenticated)
Metasploit
description | This exploits a command execution in Pi-Hole <= 4.4. A new blocklist is added, and then an update is forced (gravity) to pull in the blocklist content. PHP content is then written to a file within the webroot. Phase 1 writes a sudo pihole command to launch teleporter, effectively running a priv esc. Phase 2 writes our payload to teleporter.php, overwriting, the content. Lastly, the phase 1 PHP file is called in the web root, which launches our payload in teleporter.php with root privileges. |
id | MSF:EXPLOIT/UNIX/HTTP/PIHOLE_BLOCKLIST_EXEC |
last seen | 2020-06-10 |
modified | 2020-05-14 |
published | 2020-05-13 |
references | |
reporter | Rapid7 |
source | https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/unix/http/pihole_blocklist_exec.rb |
title | Pi-Hole heisenbergCompensator Blocklist OS Command Execution |
Packetstorm
data source https://packetstormsecurity.com/files/download/157624/pihole44-execescalate.txt id PACKETSTORM:157624 last seen 2020-05-12 published 2020-05-10 reporter Nick Frichette source https://packetstormsecurity.com/files/157624/Pi-hole-4.4-Remote-Code-Execution-Privilege-Escalation.html title Pi-hole 4.4 Remote Code Execution / Privilege Escalation data source https://packetstormsecurity.com/files/download/157623/pihole44-exec.txt id PACKETSTORM:157623 last seen 2020-05-12 published 2020-05-10 reporter Nick Frichette source https://packetstormsecurity.com/files/157623/Pi-hole-4.4-Remote-Code-Execution.html title Pi-hole 4.4 Remote Code Execution data source https://packetstormsecurity.com/files/download/157839/pihole440-exec.txt id PACKETSTORM:157839 last seen 2020-05-28 published 2020-05-27 reporter Photubias source https://packetstormsecurity.com/files/157839/Pi-hole-4.4.0-Remote-Code-Execution.html title Pi-hole 4.4.0 Remote Code Execution data source https://packetstormsecurity.com/files/download/157748/pihole_blocklist_exec.rb.txt id PACKETSTORM:157748 last seen 2020-05-19 published 2020-05-18 reporter h00die source https://packetstormsecurity.com/files/157748/Pi-Hole-heisenbergCompensator-Blocklist-OS-Command-Execution.html title Pi-Hole heisenbergCompensator Blocklist OS Command Execution
References
- http://packetstormsecurity.com/files/157623/Pi-hole-4.4-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/157624/Pi-hole-4.4-Remote-Code-Execution-Privilege-Escalation.html
- http://packetstormsecurity.com/files/157748/Pi-Hole-heisenbergCompensator-Blocklist-OS-Command-Execution.html
- http://packetstormsecurity.com/files/157839/Pi-hole-4.4.0-Remote-Code-Execution.html
- https://frichetten.com/blog/cve-2020-11108-pihole-rce/
- https://github.com/Frichetten/CVE-2020-11108-PoC
- http://packetstormsecurity.com/files/157623/Pi-hole-4.4-Remote-Code-Execution.html
- https://github.com/Frichetten/CVE-2020-11108-PoC
- https://frichetten.com/blog/cve-2020-11108-pihole-rce/
- http://packetstormsecurity.com/files/157839/Pi-hole-4.4.0-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/157748/Pi-Hole-heisenbergCompensator-Blocklist-OS-Command-Execution.html
- http://packetstormsecurity.com/files/157624/Pi-hole-4.4-Remote-Code-Execution-Privilege-Escalation.html