Description
A vulnerability in Polkit’s (PolicyKit) pkexec component identified as CVE-2021-4034 (PwnKit) is present in the default configuration of all major Linux distributions and can be exploited to gain full root privileges on the system. The issue exists within PolicyKit pkexec tool’s incorrect handling of command-line arguments.
A local unprivileged user could use this vulnerability to escalate privileges to an administrator. Example proof of concept exploitation code is currently emerging within the public domain which we will continue to monitor and update when new information becomes available. We are aware of the following proof of concept exploit code; however we would not recommend running these without performing your own due diligence;
Proof of Concept Exploit
Remediation
Vendor patches/hot fixes have been released by the respective vendors and its strongly recommended these are applied as soon as possible. A temporary mitigation for operating systems that have yet to push a patch is to strip pkexec of the SUID read/write rights with the following command:
chmod 0755 /usr/bin/pkexec
Please ensure that a review of this permission change effect would have within your environment before changing this permission.
Am I Affected?
If your OS uses policy kit and you have not updated your OS then you are likely to be affected. Updates for this issue started being issued around the 25th January 2022.The presence of policykit can be tested by checking for the existence of the pkexec binary. If your OS installs this in the standard location then the following test will show this.
$ test -f /usr/bin/pkexec && echo "pkexec exists."
Alternatively find can be used to detect pkexec installed in non-standard locations.
# find / -name pkexec -print 2>/dev/null
We continue to actively monitor the situation.
References
![](https://www.covertswarm.com/wp-content/uploads/2024/06/2024-Academy-Intake-3-640x320.png)
Academy Launches Second Intake
CovertSwarm’s Academy is opening the 2024 intake. Apply and start your cybersecurity journey as an ethical hacker.
![DORA & NIS2 European Flag](https://www.covertswarm.com/wp-content/uploads/2024/05/DORA-and-NIS2-European-Flag-640x320.png)
Combining regulation with real-world security assurance: DORA and NIS2
Whether you’re a local financial startup or a multinational food distributor, understanding how DORA and NIS2 may affect your organization is vital. With implementation dates just…
![](https://www.covertswarm.com/wp-content/uploads/2024/05/Clutch-100-fastest-growth-640x320.png)
CovertSwarm named by Clutch among Top 100 Fastest-Growing Companies
Clutch has recognized us for achieving one of the highest revenue growth rates from 2022 to 2023.