A new Polkit vulnerability
Successful exploitation of this vulnerability allows any unprivileged user to gain root privileges on the vulnerable host. Qualys security researchers have been able to independently verify the vulnerability, develop an exploit, and obtain full root privileges on default installations of Ubuntu, Debian, Fedora, and CentOS. Other Linux distributions are likely vulnerable and probably exploitable. This vulnerability has been hiding in plain sight for 12+ years and affects all versions of pkexec since its first version in May 2009.
Updates from distributors are already rolling out.
Posted Jan 25, 2022 23:27 UTC (Tue)
by Smon (guest, #104795)
[Link] (1 responses)
Posted Jan 26, 2022 2:45 UTC (Wed)
by pabs (subscriber, #43278)
[Link]
pkexec must be setuid root
There was a discussion on Debian IRC about moving pkexec to a separate package from policykit, so most systems wouldn't have it installed, unless they installed a package that needed it.
Posted Jan 25, 2022 23:43 UTC (Tue)
by dmoulding (subscriber, #95171)
[Link] (15 responses)
> 2021-11-18: Advisory sent to secalert@redhat.
But, when I just checked, it looks like some folks at the Fedora Project are scrambling at this very moment to test the patch that they received just today. Am I understanding this correctly, that RedHat was notified of this problem more than two months ago, but nothing was done in advance to prepare a patch for Fedora?
Posted Jan 25, 2022 23:53 UTC (Tue)
by Smon (guest, #104795)
[Link]
Fast fix is to `chmod 0755 /usr/bin/pkexec`
Posted Jan 26, 2022 15:43 UTC (Wed)
by mcatanzaro (subscriber, #93033)
[Link] (13 responses)
Posted Jan 26, 2022 16:51 UTC (Wed)
by yodermk (subscriber, #3803)
[Link] (12 responses)
Posted Jan 26, 2022 16:54 UTC (Wed)
by zdzichu (subscriber, #17118)
[Link] (9 responses)
Posted Jan 26, 2022 17:28 UTC (Wed)
by dmoulding (subscriber, #95171)
[Link] (8 responses)
I get that the processes are open. But I guess that by definition means this is a process that doesn't accommodate the idea of security vulnerability embargoes (which by definition cannot be handled "in the open"). Seems there could be a way to be open with everything, except embargoed fixes. I'd imagine that would be exactly along the lines of what the people who came up with this convention of embargoing security vulnerability disclosure had in mind.
Posted Jan 26, 2022 18:21 UTC (Wed)
by mbunkus (subscriber, #87248)
[Link]
1. The problem exists in pkexec, not Polkit in general.
Of course there are most likely huge Fedora-based machine farms in several organizations (universities maybe?) where arbitrary users do have unprivileged access that I'm simply not thinking about. Anyway, there's always "rm pkexec" as a temporary workaround.
Posted Jan 26, 2022 19:23 UTC (Wed)
by mcatanzaro (subscriber, #93033)
[Link] (1 responses)
Posted Feb 3, 2022 12:22 UTC (Thu)
by RedDwarf (guest, #89472)
[Link]
Posted Jan 26, 2022 19:36 UTC (Wed)
by zdzichu (subscriber, #17118)
[Link] (3 responses)
That's for nitpicking. As for your main point – yes, Fedora openness does not align with embargoes. Only way to prepare packages earlier would be to use some shadow build infrastructure, not widely visible. That would mean losing transparency, thus losing trust which is double important for security updates.
Actually, there is another way. Commits, builds, repo composes could get metadata tag like "notVisibleBefore" set to embargo lift timestamp. Before that time, it should only show changes to the owner. But this would require really intrusive surgery in many components (starting with git). It's unfeasible.
Posted Jan 26, 2022 20:05 UTC (Wed)
by dmoulding (subscriber, #95171)
[Link] (1 responses)
I just did that. So still no update available to me on this system. Not sure why if the patched build was available already.
But as to the feasibility, why is it infeasible to have closed infrastructure on which to make commits, do builds and test? Then when an embargo is lifted, the commits can be pushed to the public repo, builds done and released immediately, without having to wait for testing. Doesn't on the surface seem infeasible to me, but admittedly I'm not a developer for any distro (let alone Fedora) so I don't know what nuances would make this impractical.
Posted Jan 26, 2022 20:19 UTC (Wed)
by rahulsundaram (subscriber, #21946)
[Link]
The patched builds are available in updates-testing repo. The commits go into a spec + patches repo in https://src.fedoraproject.org/ and then the builds happen via https://koji.fedoraproject.org/koji/
Once the builds are available there, Bodhi is used to push the updates to updates-testing for public comments and testing via https://bodhi.fedoraproject.org/
In this case, for Fedora 35, this is the errata
https://bodhi.fedoraproject.org/updates/FEDORA-2022-da040...
dnf install <foo> --enablerepo=updates-testing
> But as to the feasibility, why is it infeasible to have closed infrastructure on which to make commits, do builds and test?
It isn't infeasible but it is considerable amount of work to duplicate a good amount of the infrastructure somewhere privately, find the resources to test it privately and push it out slightly earlier while still allowing community volunteers to participate.
Posted Jan 26, 2022 22:29 UTC (Wed)
by brunowolff (guest, #71160)
[Link]
If you happen to be using rawhide right now, composes have been failing more than usual the last week, including the last two days. If this threat is a high priority for you (e.g. if you have multiple users on your system that you don't fully trust to behave), then you need to pull a copy from koji or from this morning's failed compose (which will have a lot of updates).
Posted Jan 27, 2022 9:09 UTC (Thu)
by nim-nim (subscriber, #34454)
[Link]
Embargoes are predicated on the idea components are independant and you can prepare an update in a sekret top security facility isolated from everything else.
In reality modern components are deeply interdependant, moving one part echoes far and wide, and requires notifying lots of people (see: log4j).
Posted Jan 26, 2022 19:13 UTC (Wed)
by mcatanzaro (subscriber, #93033)
[Link] (1 responses)
Distros with private infrastructure (e.g. RHEL) are able to prepare more easily.
Posted Feb 5, 2022 2:30 UTC (Sat)
by xnox (guest, #63320)
[Link]
If there were enough resources committed, surely koji / fedora could implement the same. Push private tags, do builds, and unembargo them at publication time. A missing build infrastructure feature, and lack of timely security support. Not really anything to do with "openness".
Posted Jan 26, 2022 2:29 UTC (Wed)
by flussence (guest, #85566)
[Link] (11 responses)
As much as I'd like to rag on polkit for being a pile of "so complex there are no obvious deficiencies" software running as root, this actually looks like a kernel bug. There may be other software affected by this that we're not aware of yet.
Posted Jan 26, 2022 2:47 UTC (Wed)
by JoeBuck (subscriber, #2330)
[Link] (1 responses)
Posted Jan 26, 2022 18:05 UTC (Wed)
by atnot (subscriber, #124910)
[Link]
Posted Jan 26, 2022 2:49 UTC (Wed)
by bjacob (guest, #58566)
[Link] (2 responses)
Posted Jan 26, 2022 3:05 UTC (Wed)
by bjacob (guest, #58566)
[Link] (1 responses)
Posted Jan 26, 2022 4:52 UTC (Wed)
by NYKevin (subscriber, #129325)
[Link]
OTOH, there might be (read: I could imagine) some programs that fork-exec a helper program with NULL argv[0] just because it's easier than passing the correct arguments, so if the kernel returns -EINVAL or something, those programs might break.
Posted Jan 26, 2022 4:25 UTC (Wed)
by pabs (subscriber, #43278)
[Link]
Last-minute note: polkit also supports non-Linux operating systems such
Posted Jan 26, 2022 15:08 UTC (Wed)
by jreiser (subscriber, #11027)
[Link]
Posted Jan 26, 2022 16:43 UTC (Wed)
by corbet (editor, #1)
[Link] (3 responses)
Posted Jan 26, 2022 17:40 UTC (Wed)
by hmh (subscriber, #3838)
[Link] (2 responses)
Posted Jan 27, 2022 9:54 UTC (Thu)
by nye (subscriber, #51576)
[Link] (1 responses)
Posted Jan 27, 2022 12:35 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link]
Posted Jan 26, 2022 7:19 UTC (Wed)
by bof (subscriber, #110741)
[Link] (5 responses)
What would I miss, on servers / vms? I never consciously used it for sure, sudo does everything I need.
Posted Jan 26, 2022 8:07 UTC (Wed)
by rahulsundaram (subscriber, #21946)
[Link] (2 responses)
It's largely used on desktops, so probably nothing.
Posted Jan 26, 2022 9:10 UTC (Wed)
by ballombe (subscriber, #9523)
[Link]
Posted Jan 26, 2022 12:04 UTC (Wed)
by purslow (guest, #8716)
[Link]
emerge -cpv polkit
Posted Jan 26, 2022 14:02 UTC (Wed)
by dbnichol (subscriber, #39622)
[Link] (1 responses)
Posted Jan 26, 2022 16:16 UTC (Wed)
by ballombe (subscriber, #9523)
[Link]
Posted Jan 26, 2022 21:44 UTC (Wed)
by fenncruz (subscriber, #81417)
[Link] (1 responses)
Posted Jan 26, 2022 23:42 UTC (Wed)
by jebba (guest, #4439)
[Link]
Posted Jan 27, 2022 11:08 UTC (Thu)
by tarvin (guest, #4412)
[Link] (3 responses)
So it appears one cannot have a general policy for removing polkit, even though that would be nice (I fear more surprises like this could be waiting to pop up for polkit.)
My question:
Posted Jan 27, 2022 11:16 UTC (Thu)
by rahulsundaram (subscriber, #21946)
[Link]
Removing suid bit is suggested as a mitigation step for this vulnerability. That should help in general. Alternatively, locally generate an RPM with pkexec as a subpackage and just don't install it for your servers. There is a fedora devel list discussion about doing that upstream but it will likely take a while to trickle down even if they do that.
Posted Jan 27, 2022 11:52 UTC (Thu)
by anselm (subscriber, #2796)
[Link]
The polkit service as such has nothing to do with the bug. It is a problem with the way the pkexec executable deals with command line arguments, or more specifically the absence of command line arguments, combined with the fact that it is set-UID root. The exploit doesn't rely on polkit in particular at all.
Posted Jan 27, 2022 12:38 UTC (Thu)
by matthias (subscriber, #94967)
[Link]
As long as the pkexec executable is available with the SUID bit in place, this is trivially exploitable. The executable itself is the problem.
A new Polkit vulnerability
I removed suid from a lot of binaries, but sadly not pkexec.
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
Signature Date: 2022-01-25 20:05 UTC
Last Updated: 2022-01-25 22:59 UTC (53 minutes ago)
https://archlinux.org/packages/extra/x86_64/polkit/
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
2. This means that attackers must be able to execute arbitrary user-level programs in order to exploit the flaw.
3. Polkit is used mostly with desktop-style systems. Desktop-style systems are usually single-user, and that user has other ways of accessing root anyway.
4. Fedora is used much more widely as desktop systems than server systems, especially not as server systems where arbitrary users can upload arbitrary code to run (e.g. web site hosting with PHP).
A new Polkit vulnerability
A new Polkit vulnerability
- Do I want "testing"? No.
- Do I want "fast"? Yes.
Since I need to compromise, I want to know how faster is fast, and how pre-tested is testing.
A new Polkit vulnerability
It was available the testing repository since yesterday.
The package was built at 25 Jan 2022 18:11:31 UTC (https://koji.fedoraproject.org/koji/buildinfo?buildID=190...).
The code changes landed in the repo yesterday at 17:51:47 UTC (https://src.fedoraproject.org/rpms/polkit/c/a55ef1ff5db9b...)
A new Polkit vulnerability
$ sudo dnf update polkit
Fedora 35 - x86_64 37 kB/s | 13 kB 00:00
Fedora 35 openh264 (From Cisco) - x86_64 4.2 kB/s | 989 B 00:00
Fedora Modular 35 - x86_64 46 kB/s | 13 kB 00:00
Fedora 35 - x86_64 - Updates 35 kB/s | 10 kB 00:00
Fedora 35 - x86_64 - Updates 504 kB/s | 447 kB 00:00
Fedora Modular 35 - x86_64 - Updates 45 kB/s | 13 kB 00:00
Dependencies resolved.
Nothing to do.
Complete!
A new Polkit vulnerability
A new Polkit vulnerability
Composes of repos typically happens once a day with the set of packages in stable at around 0500 UTC. Typically the compose finishes 8 to 10 hours later and gets copied to the primary source for distribution. Before most people see the change, it needs to be copied to the mirror they use. I think some pick them up pretty quickly, but others might only check once a day.
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
https://stackoverflow.com/questions/49817316/can-argc-be-...
So argc can really be 0, and the standard saying so is the ISO C language standard.
So this isn't a Linux bug but I think flussence's meta point stands: there are probably many other programs that didn't know that they had to be ready for argc==0, so this is is surprising, and surprising is insecure... so it might still be a good idea for the kernel to step in to ensure argc>=1 and argv[0]!=NULL even though this isn't the kernel's fault. I'd be really curious though if there are legitimate usage patterns that would be broken by doing so..
A new Polkit vulnerability
A new Polkit vulnerability
as Solaris and *BSD, but we have not investigated their exploitability;
however, we note that OpenBSD is not exploitable, because its kernel
refuses to execve() a program if argc is 0.
The Linux kernel definitely is NOT at fault. (0 == argv[0]) is perfectly legal in the second argument to execve(), even for a file with the setuid bit set. Any bugs or surprises are the fault of the file named as the first argument to execve().
A new Polkit vulnerability
For the curious, requiring argc>=1 is currently under discussion on linux-kernel.
Fixing the kernel
Fixing the kernel
Fixing the kernel
Fixing the kernel
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
Calculating dependencies... done!
sys-auth/polkit-0.120-r1 pulled in by:
gnome-extra/polkit-gnome-0.105-r2 requires >=sys-auth/polkit-0.102
sys-auth/polkit-pkla-compat-0.1 requires >=sys-auth/polkit-0.110
sys-auth/polkit-qt-0.114.0 requires >=sys-auth/polkit-0.103
sys-fs/udisks-2.9.4 requires >=sys-auth/polkit-0.114
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
A new Polkit vulnerability
But maybe some hardening can happen, still.
Does someone know if stopping the polkit service will prevent bugs like this from being exploitable?
A new Polkit vulnerability
A new Polkit vulnerability
Does someone know if stopping the polkit service will prevent bugs like this from being exploitable?
A new Polkit vulnerability
