How a 12-Year-Old Linux Polkit Flaw (CVE-2021-4034) Grants Unlimited Root Access

Researchers uncovered a 12‑year‑old vulnerability in Linux’s Polkit (CVE‑2021‑4034, dubbed PwnKit) that lets attackers exploit the pkexec utility to gain unrestricted root privileges on most major distributions, prompting urgent patching recommendations and mitigation steps for administrators.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How a 12-Year-Old Linux Polkit Flaw (CVE-2021-4034) Grants Unlimited Root Access
Polkit vulnerability illustration
Polkit vulnerability illustration

For Linux users, the root account holds the highest privileges, allowing actions ordinary users cannot perform. This Tuesday, the root user received bad news—a 12‑year‑old flaw in the Polkit system tool enables attackers to obtain unrestricted root privileges on most machines running major open‑source operating systems.

Polkit, formerly PolicyKit, manages system‑wide permissions on Unix‑like OSes, providing a mechanism for non‑privileged processes to interact securely with privileged ones. It also lets users run high‑privilege commands via the SUID‑root program pkexec, installed on every major Linux distribution.

Qualys researchers discovered the dormant flaw last November, naming it PwnKit. After patches were applied to most Linux distributions, the vulnerability was disclosed this Tuesday. PwnKit is tracked as CVE‑2021‑4034 with a critical CVSS score of 7.8, found in Polkit’s pkexec functionality.

Long‑standing Vulnerability

Like most operating systems, Linux implements a hierarchical permission model to control when applications or users can interact with sensitive system resources, aiming to limit damage if an untrusted user gains network control or an application is compromised.

Researchers found that since 2009 pkexec contains a memory‑corruption bug. In a report on Tuesday they developed a proof‑of‑concept exploit that achieved full root access on default installations of CentOS, Debian, Fedora, and Ubuntu, and they believe other distributions may also be vulnerable.

An attacker with limited control over a vulnerable machine can use the flaw to elevate privileges to root. The exploit is trivial and reportedly 100 % reliable; if an attacker already controls a vulnerable host, they can run malicious payloads with full system rights. The vulnerability can be leveraged even when the Polkit daemon itself is not running.

Exploitation in the Wild Is Inevitable

Qualys Threat Research Director Bharat Jogi wrote that the most likely scenario involves an insider who can upgrade from no privileges to full root. From an external perspective, a hacker who establishes foothold via other vulnerabilities or credential leaks could also use this bug to gain root. The exploit requires local authentication on the target; without it, remote execution is impossible. Qualys has not released PoC code for fear it would aid attackers, though another source has published it. SANS penetration tester Bojan Zdrnja warned that the vulnerability will soon be publicly exploited, especially on multi‑user systems that allow shell access. He successfully reproduced the exploit on Ubuntu 20.04.

SANS ISC InfoSec Forums illustration
SANS ISC InfoSec Forums illustration

Similar Vulnerabilities Exist

Qualys researchers are not the first to discover this issue; similar vulnerabilities have been reported before. In 2013, researcher Ryan Mallon disclosed an almost identical Polkit flaw and even provided a patch, though he could not find a reliable exploit. In June of last year, GitHub security researcher Kevin Backhouse reported a privilege‑escalation bug tracked as CVE‑2021‑3560, which was also patched by major Linux vendors.

Mallon’s response: “Funny, I wrote a blog about this Polkit vulnerability back in 2013. I couldn’t find a practical exploit, but I did identify the root cause.”

Experts Urge Immediate Patching

Major Linux distributions have released patches for the vulnerability, and security experts strongly advise administrators to apply them promptly. Users unable to patch immediately should remove the SUID bit from /usr/bin/pkexec (chmod 0755 /usr/bin/pkexec) to prevent it from running as root when invoked by non‑privileged users. Recommendations from Debian, Ubuntu, and Red Hat are provided.

If you want to verify whether the vulnerability has been exploited on your system, check logs for entries such as “no SHELL variable found in /etc/shells” or environment variables containing suspicious content. Qualys notes that PwnKit can also be leveraged without leaving traces.

Reference links:

https://arstechnica.com/information-technology/2022/01/a-bug-lurking-for-12-years-gives-attackers-root-on-every-major-linux-distro/

https://threatpost.com/linux-bug-in-all-major-distros-an-attackers-dream-come-true/177996/

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Patchprivilege escalationpolkitRoot ExploitCVE-2021-4034
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.