Description
Qualys discovered that needrestart, before version 3.8, allows local attackers to execute arbitrary code as root by tricking needrestart into running the Ruby interpreter with an attacker-controlled RUBYLIB environment variable.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| needrestart | needrestart | < 3.8 | 3.8 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | needrestart | 3.7-3.1 | — |
| Debian 13 | needrestart | 3.7-3.1 | — |
| Debian 12 | needrestart | 3.6-4+deb12u2 | DSA-5815-1 |
| Debian 11 | needrestart | 3.5-4+deb11u4 | DLA-3957-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 24.04 LTS | libmodule-scandeps-perl | 1.35-1ubuntu0.24.04.1 | USN-7117-1 |
| Ubuntu 24.04 LTS | needrestart | 3.6-7ubuntu4.3 | USN-7117-1 |
| Ubuntu 22.04 LTS | libmodule-scandeps-perl | 1.31-1ubuntu0.1 | USN-7117-1 |
| Ubuntu 22.04 LTS | needrestart | 3.5-5ubuntu2.2 | USN-7117-1 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | libmodule-scandeps-perl | 1.27-1ubuntu0.1~esm1 | USN-7117-1 |
| Ubuntu Pro 20.04 LTS | needrestart | 3.4-6ubuntu0.1+esm1 | USN-7117-1 |
| Ubuntu Pro 18.04 LTS | libmodule-scandeps-perl | 1.24-1ubuntu0.1~esm1 | USN-7117-1 |
| Ubuntu Pro 18.04 LTS | needrestart | 3.1-1ubuntu0.1+esm1 | USN-7117-1 |
| Ubuntu Pro 16.04 LTS | libmodule-scandeps-perl | 1.20-1ubuntu0.1~esm1 | USN-7117-1 |
| Ubuntu Pro 16.04 LTS | needrestart | 2.6-1ubuntu0.1~esm1 | USN-7117-1 |
Advisories 3
- USN-7117-1 Several security issues were fixed in needrestart and Module::ScanDeps Ubuntu Security Notices (USN) · Jun 25, 2026
- DSA-5815-1 needrestart - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-3957-1 needrestart - security update Debian Security (DSA / DLA) · Mar 9, 2026