CVE-2021-4034

Red Hat Polkit Out-of-Bounds Read and Write Vulnerability

Published 28 Jan 2022 Updated 15 Aug 2026 CNA: redhat

Known exploited

CISA added this CVE to its list of known exploited vulnerabilities on 27 Jun 2022. US federal agencies had to act by 18 Jul 2022.

Name
Red Hat Polkit Out-of-Bounds Read and Write Vulnerability
Required action
Apply updates per vendor instructions.
Ransomware
Known to be used in ransomware campaigns
Notes
https://nvd.nist.gov/vuln/detail/CVE-2021-4034

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.

Severity (CVSS)

7.8 high CVSS 3.1 from CISA (ADP)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 94.9%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 99.9% of all scored CVEs. Scores of 26 Nov 2026.

The assessment of CISA (SSVC, 27 Jun 2022):

Exploitation
active: CISA has reliable evidence of exploitation in the wild
Automatable
no: each attack takes manual steps
Technical impact
total: full control of the component or of its data

Weakness

Affected products

As the CNA lists them.

ProductVersions
polkit
n/a
affected all

Is my server affected?

Find the installed version of polkit and compare it with the fixed version of your distribution. Distributions often fix a CVE in their own package version, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i polkit
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-4034 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-4034

RHEL, Rocky, Alma, Fedora

rpm -q polkit
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-4034

Alpine

apk list --installed | grep -i polkit

With Trivy, on the host and for a container image; it prints the installed and the fixed version when a package is affected:

trivy rootfs --scanners vuln / | grep CVE-2021-4034
trivy image --scanners vuln IMAGE | grep CVE-2021-4034

Patchbrief matches the package lists of your Linux servers and containers every day against the Trivy vulnerability database, which covers the packages of Linux distributions and language packages (npm, PyPI, Go, Maven and others), and sends one digest with the command that fixes each problem. Install the agent.

References

Advisories

Other references

Guides

Source: the record CVE-2021-4034 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.