D-Bus Authentication Bypass
CVE-2021-3560
Last updated
Was this helpful?
CVE-2021-3560
Last updated
Was this helpful?
The vulnerability can be boiled down to these steps:
The attacker manually sends a dbus message to the accounts-daemon requesting the creation of a new account with sudo permissions (or latterly, a password to be set for the new user). This message gets given a unique ID by the dbus-daemon.
The attacker kills the message after polkit receives it, but before polkit has a chance to process the message. This effectively destroys the unique message ID.
Polkit asks the dbus-daemon for the user ID of the user who sent the message, referencing the (now deleted) message ID.
The dbus-daemon can't find the message ID because we killed it in step two. It handles the error by responding with an error code.
Polkit mishandles the error and substitutes in 0 for the user ID -- i.e. the root account of the machine.
Thinking that the root user requested the action, polkit allows the request to go through unchallenged.
In short, by destroying the message ID before the dbus-daemon has a chance to give polkit the correct ID, we exploit the poor error-handling in polkit to trick the utility into thinking that the request was made by the all-powerful root user. -
See the full vulnerability explain on the official Kevin Backhouse article.
Many of the most popular Linux distributions didn’t ship the vulnerable version until more recently. You may run Polkit exploit on the following targets:
RHEL 8
Fedora 21 (or later)
Debian testing (“bullseye”)
Ubuntu 20.04
LTS ("Focal Fossa")
Others may also be vulnerables if you find that the installed polkit package is vulnerable. Affected versions are 0.113 (or later) for rhel,centos,fedora
and 0.105-26 for Debian/Ubuntu
Additionally, This exploit works only on distributions that have installed accountsservice
and gnome-control-center