vendor:
PolicyKit-1
by:
Lance Biggerstaff
7.8
CVSS
HIGH
Privilege Escalation
269
CWE
Product Name: PolicyKit-1
Affected Version From: 0.105-31
Affected Version To: 0.105-31
Patch Exists: YES
Related CWE: CVE-2021-4034
CPE: a:polkit:policykit-1
Metasploit:
https://www.rapid7.com/db/vulnerabilities/huawei-euleros-2_0_sp3-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/alma_linux-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/centos_linux-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/rocky_linux-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/amazon-linux-ami-2-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/huawei-euleros-2_0_sp5-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/huawei-euleros-2_0_sp8-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/huawei-euleros-2_0_sp9-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/huawei-euleros-2_0_sp10-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/oracle-solaris-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/gentoo-linux-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/debian-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/suse-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/oracle_linux-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/freebsd-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/redhat_linux-cve-2021-4034/, https://www.rapid7.com/db/vulnerabilities/ubuntu-cve-2021-4034/
Platforms Tested: Linux
2022
PolicyKit-1 0.105-31 – Privilege Escalation
The exploit consists of three files `Makefile`, `evil-so.c` & `exploit.c`. The Makefile is used to compile the evil-so.c and exploit.c files. The evil-so.c file contains code to set the UID and GID to 0 and execute a shell. The exploit.c file creates a directory and a gconv-modules file, copies the evil.so file to the directory and executes the pkexec binary with the environment variables set to the directory. This allows the evil.so file to be loaded and executed.
Mitigation:
The user should update to the latest version of PolicyKit-1 and ensure that the environment variables are not set to a malicious directory.