Description
needrestart 0.8 through 3.5 before 3.6 is prone to local privilege escalation. Regexes to detect the Perl, Python, and Ruby interpreters are not anchored, allowing a local user to escalate privileges when needrestart tries to detect if interpreters are using old source files.
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.6-1 | — |
| Debian 13 | needrestart | 3.6-1 | — |
| Debian 12 | needrestart | 3.6-1 | — |
| Debian 11 | needrestart | 3.5-4+deb11u1 | DSA-5137-1 |
| Debian 10 | needrestart | 3.4-5+deb10u1 | DSA-5137-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 9 | needrestart | 2.11-3+deb9u2 | DLA-3013-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | needrestart | 3.5-5ubuntu2.1 | USN-5426-1 |
| Ubuntu 20.04 LTS | needrestart | 3.4-6ubuntu0.1 | USN-5426-1 |
| Ubuntu 18.04 LTS | needrestart | 3.1-1ubuntu0.1 | USN-5426-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 16.04 LTS | needrestart | No fix yet | — |
Advisories 3
- USN-5426-1 needrestart vulnerability Ubuntu Security Notices (USN) · Apr 27, 2026
- DSA-5137-1 needrestart - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-3013-1 needrestart - security update Debian Security (DSA / DLA) · Mar 9, 2026
References
- https://github.com/liske/needrestart/releases/tag/v3.6
- https://github.com/liske/needrestart/commit/e6e58136e1e3c92296e2e810cb8372a5fe0dbd30
- https://lists.debian.org/debian-security-announce/2022/msg00105.html
- https://www.openwall.com/lists/oss-security/2022/05/17/9
- [oss-security] 20220517 CVE-2022-30688: needrestart 0.8+ local privilege escalation mailing-list
- DSA-5137 vendor-advisory
- [debian-lts-announce] 20220518 [SECURITY] [DLA 3013-1] needrestart security update mailing-list