Skip to content
Access control Write-up Advanced

Abusing Ubuntu 24.04 features for root privilege escalation

A privileged DBus interface for managing the cups printing daemon could be called without a password by local users in the sudo or lpadmin groups, and a missing return-value check in cups socket setup allowed a symlink to be chmod'd as root. Chaining this with control over cups configuration files let a default desktop user escalate to root.

snyk.io

Published on snyk.io

With the recent release of Ubuntu 24.04, we at Snyk Security Labs thought it would be interesting to examine the latest version of this Linux distribution to see if we could find any interesting privilege escalation vulnerabilities.

The author, on snyk.io

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the cups socket setup code called chmod on a path without checking whether bind had failed, so a pre-placed symlink was followed, and the resulting write access to cups configuration files allowed a privileged helper to be repointed.

What the attacker needed

Local user in sudo or lpadmin group; logged in at the desktop session; default Ubuntu 24.04 Desktop install

The fix

The vulnerabilities were fixed by the respective maintainers, with patches generally available as of 6 August 2024.

How it was found

  1. Enumerate DBus services on a fresh Ubuntu 24.04 install and find the cups management interface.
  2. Call the settings getter to obtain a valid settings dictionary, then the setter to change the Listen value.
  3. Place a symlink at the chosen Listen path so the privileged chmod follows it.
  4. Use the resulting write access to cups configuration files to set the group used for external programs.
  5. Trigger cups to run an external program as that group to gain a root shell.

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 write-up has not been written yet. The Original tab links to the source.

On Ubuntu, some background services run with full administrator power and offer ways for ordinary programs to ask them to do things. A printing service could be tricked into changing permissions on a file of the attacker's choosing, and by editing the printing service's own settings files the attacker could make it run commands as the all-powerful root user.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.