Description Preview
The pkexec utility, part of the polkit authentication framework, contains a critical vulnerability that allows local users to escalate privileges to root. The vulnerability stems from improper handling of command parameters, causing pkexec to potentially execute environment variables as commands. An attacker can craft specific environment variables to trigger arbitrary code execution with elevated privileges. This vulnerability affects most major Linux distributions and has been actively exploited in the wild. Security researchers from Qualys discovered and named this vulnerability "PwnKit."
Overview
CVE-2021-4034 (PwnKit) is a memory corruption vulnerability in the pkexec component of polkit, a system service that manages system-wide privileges in Unix-like operating systems. The vulnerability exists because pkexec fails to properly validate the number of arguments passed to it and attempts to execute environment variables as commands. This vulnerability is particularly dangerous because:
- It affects virtually all Linux distributions
- It has existed in the polkit codebase since May 2009 (version 0.113)
- It can be exploited by any local user without authentication
- Exploitation leads to complete system compromise (root privileges)
- The attack vector involves out-of-bounds reads (CWE-125) and buffer overflows (CWE-787)
Remediation
To mitigate this vulnerability, system administrators should:
-
Apply vendor-supplied security patches immediately:
- Update the polkit package to the patched version provided by your distribution
- Most major Linux distributions have released security updates
-
If patching is not immediately possible, consider these temporary mitigations:
- Remove the SUID bit from the pkexec binary:
chmod 0755 /usr/bin/pkexec
- This will prevent pkexec from running with elevated privileges but may impact system functionality
- Remove the SUID bit from the pkexec binary:
-
Monitor systems for signs of exploitation:
- Check for unauthorized privilege escalation
- Review system logs for suspicious pkexec activity
- Implement network monitoring for indicators of compromise
-
Follow distribution-specific guidance:
- Red Hat: https://access.redhat.com/security/vulnerabilities/RHSB-2022-001
- SUSE: https://www.suse.com/support/kb/doc/?id=000020564
References
- Qualys Security Advisory: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
- Red Hat Security Bulletin: https://access.redhat.com/security/vulnerabilities/RHSB-2022-001
- Polkit patch commit: https://gitlab.freedesktop.org/polkit/polkit/-/commit/a2bf5c9c83b6ae46cbd5c779d3055bff81ded683
- Technical analysis: https://www.secpod.com/blog/local-privilege-escalation-vulnerability-in-major-linux-distributions-cve-2021-4034/
- Exploit details: http://packetstormsecurity.com/files/166196/Polkit-pkexec-Local-Privilege-Escalation.html
- SUSE KB article: https://www.suse.com/support/kb/doc/?id=000020564
- Siemens advisory: https://cert-portal.siemens.com/productcert/pdf/ssa-330556.pdf
- Oracle security advisory: https://www.oracle.com/security-alerts/cpuapr2022.html
Early Warning
Armis Early Warning customers received an advanced alert on this vulnerability.
- Armis Alert Date
- Feb 7, 2022
- CISA KEV Date
- Jun 27, 2022
140days early
Industry ExposureMost to leastThis section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.
- ManufacturingManufacturing
- Health Care & Social AssistanceHealth Care & Social Assistance
- Public AdministrationPublic Administration
- Finance and InsuranceFinance and Insurance
- Professional, Scientific, & Technical ServicesProfessional, Scientific, & Technical Services
- Transportation & WarehousingTransportation & Warehousing
- UtilitiesUtilities
- Educational ServicesEducational Services
- Retail TradeRetail Trade
- Other Services (except Public Administration)Other Services (except Public Administration)
- Arts, Entertainment & RecreationArts, Entertainment & Recreation
- InformationInformation
- Management of Companies & EnterprisesManagement of Companies & Enterprises
- Agriculture, Forestry Fishing & HuntingAgriculture, Forestry Fishing & Hunting
- Accommodation & Food ServicesAccommodation & Food Services
- Wholesale TradeWholesale Trade
- Administrative, Support, Waste Management & Remediation ServicesAdministrative, Support, Waste Management & Remediation Services
- ConstructionConstruction
- MiningMining
- Real Estate Rental & LeasingReal Estate Rental & Leasing