GHSL-2020-202: Local Privilege Escalation (LPE) in Ubuntu gdm3 - CVE-2020-16125
gdm3 can be tricked into launching gnome-initial-setup when the accountsservice daemon is unresponsive, allowing an unprivileged user to create a new sudo-enabled account and gain root privileges.
Originally disclosed on GitHub Security Lab
gdm3 can be tricked into launching gnome-initial-setup, enabling an unprivileged user to create a new user account for themselves. The new account is a member of the sudo group, so this enables the unprivileged user to obtain admin privileges.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the default value of the flag indicating existing user accounts is false, and it remains false when the D-Bus call to accountsservice fails, causing gdm3 to incorrectly believe no accounts exist.
Impact
An unprivileged local user could gain root privileges by exploiting this vulnerability, but only if they can also make accountsservice unresponsive (e.g., via a separate DoS vulnerability).
What the attacker needed
Local access to the system; ability to make accountsservice unresponsive
The fix
The default value of the flag indicating existing user accounts should be set to true, so that a failed D-Bus call does not incorrectly indicate no accounts exist.
How it was found
- Trigger a denial-of-service in accountsservice to make it unresponsive.
- gdm3 attempts to list users via D-Bus but times out.
- gdm3 logs 'Failed to list cached users' and leaves have_existing_user_accounts false.
- gdm3 launches gnome-initial-setup.
- Create a new user account, which is added to the sudo group.
- Use the new account to gain root privileges.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a computer starts, a program called gdm3 checks if any user accounts exist. If it thinks there are none, it runs a setup tool that lets you create a new administrator account. The check fails if a background service (accountsservice) doesn't respond in time, so gdm3 wrongly assumes no accounts exist. An attacker can make that service unresponsive, then create their own admin account.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.