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.
https://github.com/CyberCrowCC/CVE-2024-48990
https://github.com/njeru-codes/needrestart-vulnerability-poc
https://www.openwall.com/lists/oss-security/2024/11/19/1
https://www.cve.org/CVERecord?id=CVE-2024-48992
https://lists.debian.org/debian-lts-announce/2024/11/msg00014.html
https://github.com/liske/needrestart/commit/b5f25f6ec6e7dd0c5be249e4e45de4ee9ffe594f