Major Linux PolicyKit security vulnerability uncovered: Pwnkit:
Polkit, formerly known as PolicyKit, is a systemd SUID-root program. It's installed by default in every major Linux distribution.
[...] This vulnerability is easy to exploit. And, with it, any ordinary user can gain full root privileges on a vulnerable computer by exploiting this vulnerability in its default configuration. As Qualys wrote in its brief description of the problem: "This vulnerability is an attacker's dream come true."
[...] Why is it so bad? Let us count the ways:
- Pkexec is installed by default on all major Linux distributions.
- Qualys has exploited Ubuntu, Debian, Fedora, and CentOS in their tests, and they're sure other distributions are also exploitable.
- Pkexec has been vulnerable since its creation in May 2009 (commit c8c3d83, "Add a pkexec(1) command").
- An unprivileged local user can exploit this vulnerability to get full root privileges.
- Although this vulnerability is technically a memory corruption, it is exploitable instantly and reliably in an architecture-independent way.
- And, last but not least, it's exploitable even if the polkit daemon itself is not running.
[...] While we know Linux can be attacked, Solaris and other Unix systems may also be vulnerable. We do know, however, that OpenBSD can't be attacked by exploits using this vulnerability.
Red Hat rates the PwnKit as having a Common Vulnerability Scoring System (CVSS) score of 7.8. This is high.
When used correctly, Polkit provides an organized way for non-privileged processes to communicate with privileged processes. It is also possible to use polkit to execute commands with elevated privileges using the command pkexec followed by the command intended to be executed with root permission.
(Score: 5, Informative) by Snospar on Thursday January 27 2022, @08:38AM (5 children)
Running Void Linux here which is systemd free (using runit instead). I had pkexec version 0.119 which was already safe (0.118 was the last dangerous version) but I've upgraded to 0.120 just to be sure. Always useful in these discussions to make it clear which versions are dodgy and which have been fixed.
Huge thanks to all the Soylent volunteers without whom this community (and this post) would not be possible.
(Score: 0) by Anonymous Coward on Thursday January 27 2022, @08:48AM
I just checked my pkexec (Arch derivative distro) - version 0.120. As almost always, by the time an article hits "THE HEADLINES!!!" the fix has already come and been through the regular updates. Yawn...
(Score: 0) by Anonymous Coward on Thursday January 27 2022, @09:23AM
I thought about that but decided against it. All of the major distros already patched it as have their downstreams. But the problem is that what versions are or are not dodgy can be specific to particular distros and particular releases of distros.
(Score: 0) by Anonymous Coward on Thursday January 27 2022, @10:26PM
You are thinking of a different vulnerability. The one fixed in 0.119 was a problem with dbus. Even 0.120 is vulnerable to this. You will need to get a 0.120 patched with a fix, or disable pkexec as a workaround (probably a painless one for personal use, as everyone uses sudo, not pkexec, although corporate users sometimes prefer pkexec).
Documentation is scarce because most distros for some reason no longer report exact package versions in their security bulletins (users shouldn't have to worry their pretty little heads over what version of software they have), but you can see the security tickets for Gentoo here [gentoo.org].
(Score: 2) by Runaway1956 on Friday January 28 2022, @12:42AM (1 child)
+1 informative
However, MX introduces some confusion.
.105 is obviously not up to date with .118, .119, or .120.
Package manager says that mx-pkexec provides my pkexec, and it is at version 21.03.02. It isn't clear to me, based on that, whether I'm patched or not patched.
Internet search "is my pkexec vulnerable" leads to https://support.cpanel.net/hc/en-us/articles/4420357490455-Polkit-pkexec-vulnerability-CVE-2021-4034 [cpanel.net]
Results say
It seems that my version is patched, despite being multiple versions out of date.
(Score: 0) by Anonymous Coward on Friday January 28 2022, @02:05AM
Is it really informative if the information is wrong? 0.119 and 0.120 ARE vulnerable unless patched.
Anyway, it's possible to backport the fix, so you might be running a distro that did that. Gentoo backported it to 0.117 which, for some reason, is the newest version supported on some non-x86 platforms.
If you don't use pkexec, you can avoid worrying with good old-fashioned chmod 0.