CVE-2021-4034 — polkit
HIGHCVE-2021-4034 is a high-severity (CVSS 7.8) Out-of-bounds Write vulnerability. It is in CISA's Known Exploited Vulnerabilities catalog (added 2022-06-27) and has been used in ransomware campaigns — treat it as actively exploited and patch now. A fix is available — see the affected versions and patch details below.
Exploitation Status
Actively exploited in the wild
- Confirmed by CISA's Known Exploited Vulnerabilities catalog on 2022-06-27 — including use in ransomware campaigns. Federal agencies were required to remediate by 2022-07-18.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA (KEV catalog and SSVC triage) for CVE-2021-4034.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-4034 by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the ≥ 90% band (highlighted). Counts from FIRST.org, log-scaled.
Description
A local privilege escalation vulnerability was found on polkit's pkexec utility. The pkexec application is a setuid tool designed to allow unprivileged users to run commands as privileged users according predefined policies. The current version of pkexec doesn't handle the calling parameters count correctly and ends trying to execute environment variables as commands. An attacker can leverage this by crafting environment variables in such a way it'll induce pkexec to execute arbitrary code. When successfully executed the attack can cause a local privilege escalation given unprivileged users administrative rights on the target machine.
Affected Products
ubuntu linuxcanonicalhttp serveroraclezfs storage appliance kitoraclepolkitpolkit_projectenterprise linuxredhatenterprise linux desktopredhatResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
PolicyKit-1 0.105-31 - Privilege Escalation
by Lance Biggerstaff · Jan 27, 2022
Detection & mitigation playbook
VulnerabilityDetect
Identify every host running the affected component and compare the installed build against the fixed version below — for source-built or distro-packaged software the version string, not a lockfile, is the source of truth (`dpkg -l`, `rpm -q`, or the binary's own `--version`).
Fix
Upgrade the affected component to the fixed release for CVE-2021-4034, or apply your distribution's backported patch — distro builds are often patched at an older version number, so check your vendor's advisory rather than the upstream version alone.
Workarounds
Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
For customers who cannot update immediately and doesn't have Secure Boot feature enabled, the issue can be mitigated by executing the following steps: 1) Install required systemtap packages and dependencies as per - pointed by https://access.redhat.com/solutions/5441 2) Install polkit debug info: ~~~ debuginfo-install polkit ~~~ 3) Create the following systemtap script, and name it pkexec-block.stp: ~~~ probe process("/usr/bin/pkexec").function("main") { if (cmdline_arg(1) == "") raise(9); } ~~~ 4) Load the systemtap module into the running kernel: ~~~ stap -g -F -m stap_pkexec_block pkexec_block.stp ~~~ 5) Ensure the module is loaded: ~~~ lsmod | grep -i…Source: Red Hat security advisory for CVE-2021-4034 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Enterprise Linux 6 Extended Lifecycle Support | polkit-0:0.96-11.el6_10.2 | RHSA-2022:0269 |
| Red Hat Enterprise Linux 7 | polkit-0:0.112-26.el7_9.1 | RHSA-2022:0274 |
| Red Hat Enterprise Linux 7.3 Advanced Update Support | polkit-0:0.112-12.el7_3.1 | RHSA-2022:0270 |
| Red Hat Enterprise Linux 7.4 Advanced Update Support | polkit-0:0.112-12.el7_4.2 | RHSA-2022:0272 |
| Red Hat Enterprise Linux 7.6 Advanced Update Support | polkit-0:0.112-18.el7_6.3 | RHSA-2022:0271 |
| Red Hat Enterprise Linux 7.7 Advanced Update Support | polkit-0:0.112-22.el7_7.2 | RHSA-2022:0273 |
| Red Hat Enterprise Linux 8 | polkit-0:0.115-13.el8_5.1 | RHSA-2022:0267 |
| Red Hat Enterprise Linux 8.1 Update Services for SAP Solutions | polkit-0:0.115-9.el8_1.2 | RHSA-2022:0268 |
Frequently Asked Questions
Is CVE-2021-4034 in your dependencies?
Find it across , including transitive dependencies.