Sulat.com / Writing on AIFriday, November 20, 2026
Security/20 November 2026

Local root in needrestart hits Debian 12 and Ubuntu 24.04; Ubuntu and Debian 13 have fixes

Armaan Sandhu found that needrestart, which runs after apt, can be tricked into running a process name as root. Ubuntu and Debian 13 have fixes; Debian's advisories list no Debian 12 package.

Glossy 3D Ubuntu and Debian logos stand in a dark server room beside a terminal showing a root prompt, with a glowing line running from an unlocked padlock.

At a glance

  • Armaan Sandhu says a local user can reach root through needrestart on Debian 12 (3.6-4+deb12u3) and Ubuntu 24.04 (3.6-7ubuntu4.5), triggered by the next root apt or dpkg run.
  • On Debian 13 a local user can make needrestart treat their process as root's session and run notify-send as root, but Sandhu didn't reproduce command execution there.
  • Ubuntu published USN-9151-1 on 18 November with fixes for 26.10, 26.04, 24.04 and 22.04, and Ubuntu Pro fixes for 20.04 and 18.04. Debian's DSA 6637-2 gives Debian 13 version 3.11-1.1~deb13u2.
  • The hook exits at its first check if notify-send is missing, and setting NR_NOTIFYD_DISABLE_NOTIFY_SEND to 1 switches the hook off until a fixed package is installed.

A local user can reach root on Debian and Ubuntu through needrestart, the tool that runs after apt and dpkg to report which services need a restart, according to Armaan Sandhu’s write-up of CVE-2026-124757. Ubuntu has fixes for every release it lists, and Debian’s advisories cover Debian 13.

Sandhu posted the write-up to the oss-security mailing list on 17 November, after the disclosure date agreed with the Linux distributions. Red Hat assigned the CVE. Sandhu confirmed root in a lab on Debian 12 (needrestart 3.6-4+deb12u3) and Ubuntu 24.04 (3.6-7ubuntu4.5), with root as the only target.

Debian 13 (3.11-1) is partly affected. A local user can make needrestart treat their process as root’s session, and the packaged hook then runs notify-send as root with a display and text the attacker picks. Sandhu didn’t reproduce command execution there.

How the attack works

needrestart works out which login session a process belongs to by matching text in the process’s cgroup path, the systemd record of where a process sits in the service tree. The match wasn’t anchored to the start of the path. A user can create a directory inside their own [email protected] cgroup with a name that looks like root’s session, and needrestart files their process under root.

The notification hook, 400-notify-send, then uses that process’s name, which the process sets for itself. On Debian 12 and Ubuntu 24.04 the hook pastes the name into a shell command that su runs as root, so a name carrying shell syntax runs as root. Any apt or dpkg run as root with the stock apt hook starts needrestart afterwards. Sandhu tested with apt-get and didn’t test unattended-upgrades.

Four-step flow: a local user makes a folder named like root’s session, needrestart files their process under root, the next root apt run starts the notify hook, and the process name runs as root.
A forged folder name gets a user’s process treated as root’s, and the hook then runs its name as root.

Upstream notes the hook runs whenever needrestart runs, so systems that call it from automation or monitoring can be affected too. The script checks for /usr/bin/notify-send first and exits at once if it isn’t there. That program comes from the libnotify-bin package.

Flowchart: root runs needrestart after apt or dpkg, then asks if notify-send is installed; no means the hook exits first, yes means the hook runs and needs patching or switching off.
The hook’s first check is whether notify-send exists; without it, the hook stops before running anything.

Who has a fix

Upstream maintainer Thomas Liske reviewed a three-patch fix and tagged needrestart 3.11.1 on 17 November. The patches pass the notification text to the hook through environment variables, anchor the systemd cgroup matches, and replace non-printable characters in process names with question marks. Sandhu says the second patch doesn’t apply cleanly to the 3.6 series and needs a backport.

Ubuntu published USN-9151-1 on 18 November and rates the issue High. The fixed versions are 3.11-1ubuntu2.26.10.1 on 26.10, 3.11-1ubuntu2.26.04.1 on 26.04 LTS, 3.6-7ubuntu4.6 on 24.04 LTS and 3.5-5ubuntu2.6 on 22.04 LTS. The fixes for 20.04 LTS and 18.04 LTS come through Ubuntu Pro.

Debian published DSA 6637-1 on 18 November with version 3.11-1.1~deb13u1 for Debian 13. That update carried a regression from an incorrect backport in how notify-send reaches a user session over dbus, and DSA 6637-2 on 19 November replaced it with 3.11-1.1~deb13u2. Neither advisory lists a Debian 12 package.

List of fix status by release: Ubuntu 26.10, 26.04, 24.04 and 22.04 fixed, Ubuntu 20.04 and 18.04 fixed with Ubuntu Pro, Debian 13 fixed, Debian 12 has no package in the advisories.
Ubuntu lists a fix for every release it covers; Debian’s advisories name only trixie.

Switching the hook off

The hook script exits with a “disabled in global config” message when NR_NOTIFYD_DISABLE_NOTIFY_SEND is set to 1. Security firm Corgea’s write-up puts that setting in /etc/needrestart/notify.conf as the mitigation until a fixed package is installed:

echo "NR_NOTIFYD_DISABLE_NOTIFY_SEND='1'" | sudo tee -a /etc/needrestart/notify.conf

needrestart still lists services that need a restart with the hook off. Desktop users lose its restart pop-up. Sandhu’s timeline has the flaw reported to upstream on 23 October, to the Debian and Ubuntu security teams on 5 November and to the linux-distros list on 8 November.


Discover more from Sulat AI & Tech News

Subscribe to get the latest posts sent to your email.