CVE-2021-4034
Red Hat Polkit Out-of-Bounds Read and Write Vulnerability
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)
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
- CWE-787 Out-of-bounds Write
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
|
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-4034RHEL, Rocky, Alma, Fedora
rpm -q polkit
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-4034Alpine
apk list --installed | grep -i polkitWith 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
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-4034 cisa.gov · government resource
Other references
- https://access.redhat.com/security/vulnerabilities/RHSB-2022-001 access.redhat.com
- https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt qualys.com
- https://bugzilla.redhat.com/show_bug.cgi?id=2025869 bugzilla.redhat.com
- https://gitlab.freedesktop.org/polkit/polkit/-/commit/a2bf5c9c83b6ae46cbd5c779d3055bff81ded683 gitlab.freedesktop.org
- https://www.oracle.com/security-alerts/cpuapr2022.html oracle.com
- http://packetstormsecurity.com/files/166196/Polkit-pkexec-Local-Privilege-Escalation.html packetstormsecurity.com
- http://packetstormsecurity.com/files/166200/Polkit-pkexec-Privilege-Escalation.html packetstormsecurity.com
- https://www.suse.com/support/kb/doc/?id=000020564 suse.com
- https://cert-portal.siemens.com/productcert/pdf/ssa-330556.pdf cert-portal.siemens.com
- https://www.starwindsoftware.com/security/sw-20220818-0001/ starwindsoftware.com
- https://www.secpod.com/blog/local-privilege-escalation-vulnerability-in-major-linux-distributions-cve-2021-4034/ secpod.com
- https://www.vicarius.io/vsociety/posts/pwnkit-pkexec-lpe-cve-2021-4034 vicarius.io
Guides
- What is a CVE? IDs, CNAs and the CVE List What a CVE ID names, who assigns it, what a CVE record contains and what the states RESERVED, PUBLISHED and REJECTED mean.
- PwnKit (CVE-2021-4034): root from any account through pkexec A twelve-year-old bug in the setuid program pkexec gave root to any local user on most Linux distributions. How it worked, how to check, the chmod mitigation.
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.