CVE-2021-4034: Red Hat Polkit Out-of-Bounds Read and Write
Red Hat Polkit · listed in the CISA catalog of actively exploited vulnerabilities since 2022-06-27.
- CVSS v3.1 (CVE record)
- 7.8
- high
- EPSS (exploit probability, 30 days)
- 95%
- higher than 99.8% of all CVEs
- Added to CISA KEV
- 2022-06-27
- US federal due date 2022-07-18
- Ubuntu priority
- high
CVE-2021-4034 explained
CVE-2021-4034 is a local privilege escalation flaw in the pkexec utility of Red Hat Polkit. pkexec is a setuid tool and mishandles its calling parameter count, so it can end up executing environment variables as commands. It is listed in the CISA Known Exploited Vulnerabilities catalog with known ransomware use.
Impact
A local attacker with a low-privileged account can craft environment variables that make pkexec execute arbitrary code. Successful exploitation grants administrative rights on the target machine. The attack needs no user interaction and has low complexity. Confidentiality, integrity and availability impact are all high. The attack vector is local, so the attacker must already be able to run code as an unprivileged user on the system.
Who is affected
The policykit-1 source package is affected on Ubuntu 14.04 LTS, 16.04 LTS, 18.04 LTS, 20.04 LTS and 22.04 LTS. All listed releases have fixed versions. Ubuntu 22.04 LTS: 0.105-31ubuntu1. Ubuntu 20.04 LTS: 0.105-26ubuntu1.2. Ubuntu 18.04 LTS: 0.105-20ubuntu0.18.04.6. Both are in the standard archive, though standard support for these releases has ended. Ubuntu 16.04 LTS (0.105-14.1ubuntu0.5+esm1) and Ubuntu 14.04 LTS (0.105-4ubuntu3.14.04.6+esm1) are end of life and get fixes only through Ubuntu Pro (ESM).
Written with AI from the data on this page and checked against it automatically.
Official 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.
CISA required action: Apply updates per vendor instructions.
CISA notes
Upstream versions (CVE record)
From the CVE record published by the vendor or CVE numbering authority.
- polkitAffectedFixed in
- all versions
not stated
| Product | Affected | Fixed in |
|---|---|---|
| polkit |
| not stated |
Ubuntu and Debian releases
A server is vulnerable if it has a package built from the listed source package installed in a version lower than the fixed version for its release.
Ubuntu 22.04 LTS·policykit-1
Fixed: 0.105-31ubuntu1
Ubuntu 20.04 LTS·policykit-1
Fixed: 0.105-26ubuntu1.2
Ubuntu 18.04 LTS·policykit-1
Fixed: 0.105-20ubuntu0.18.04.6
Ubuntu 16.04 LTS·policykit-1
fix via Ubuntu Pro
Fixed: 0.105-14.1ubuntu0.5+esm1
Ubuntu 14.04 LTS·policykit-1
fix via Ubuntu Pro
Fixed: 0.105-4ubuntu3.14.04.6+esm1
What to do
- Update
policykit-1to the fixed version for your release, or a later version. - On Ubuntu 14.04 LTS and 16.04 LTS, enable Ubuntu Pro (ESM) to get the fix, and plan an upgrade to a supported release.
- On Ubuntu 18.04 LTS and 20.04 LTS, apply the fix and plan an upgrade, since standard support has ended.
- Check the installed
policykit-1version on every host to confirm the update was applied. - Prioritize this update because the flaw is known to be exploited, including in ransomware campaigns.
Written with AI from the data on this page and checked against it automatically.
Check and fix on a server
Run on each Ubuntu or Debian server. Replace policykit-1 with the source package from the table above.
1. Show installed packages built from the source package, with their versions
dpkg-query -W -f='${binary:Package} ${Version} ${source:Package}\n' | awk '$3=="policykit-1"'2. Compare each installed version with the fixed version for your release from the table
I=INSTALLED_VERSION; F=FIXED_VERSION # replace both
dpkg --compare-versions "$I" lt "$F"; case $? in 0) echo vulnerable ;; 1) echo "fixed or newer" ;; *) echo "check the versions" ;; esac3. Install the fix
sudo apt update && sudo apt install --only-upgrade $(dpkg-query -W -f='${binary:Package} ${source:Package}\n' | awk '$2=="policykit-1"{print $1}')Services keep running the old code until they are restarted – restart the affected service or check with needrestart.
Rows marked “fix via Ubuntu Pro”: these fixes are only installable with an Ubuntu Pro subscription (ESM). Attach the machine first (sudo pro attach, then sudo pro enable esm-infra esm-apps), then run the commands above.
CISA's assessment (SSVC)
- Exploitation
- Exploited in the wild
- Automatable
- No – each attack needs manual steps
- Technical impact
- Total – full control of the component or total information disclosure
Weakness: CWE-787 (CWE-787|CWE-125)
Questions about CVE-2021-4034
- Can this be exploited remotely?
- No. The attack vector is local. An attacker needs low-privileged access to the machine first. Once they have it, they can gain administrative rights without user interaction.
- Is this vulnerability actively exploited?
- Yes. CISA added CVE-2021-4034 to its Known Exploited Vulnerabilities catalog on 2022-06-27 and lists known ransomware use. The required action is to apply updates per vendor instructions.
- Which package do I need to update on Ubuntu?
- Update the
policykit-1package, which providespkexec. For example, Ubuntu 22.04 LTS is fixed in0.105-31ubuntu1and Ubuntu 20.04 LTS in0.105-26ubuntu1.2.
Written with AI from the data on this page and checked against it automatically.
References
Other advisories
Data: CISA Known Exploited Vulnerabilities (public domain) · CVE Program records incl. CISA ADP enrichment · OSV.dev (CC BY 4.0) incl. Ubuntu and Debian security data · FIRST EPSS · endoflife.date. Updated automatically – facts last changed 2026-11-21. Always confirm with the vendor's or distribution's advisory before patching.