Qualys discovered that needrestart, before version 3.8, passes unsanitized data to a library (Modules::ScanDeps) which expects safe input. This could allow a local attacker to execute arbitrary shell commands. Please see the related CVE-2024-10224 in Modules::ScanDeps.
https://thehackernews.com/2024/11/decades-old-security-vulnerabilities.html
https://www.openwall.com/lists/oss-security/2024/11/19/1
https://www.cve.org/CVERecord?id=CVE-2024-11003
https://www.cve.org/CVERecord?id=CVE-2024-10224
https://github.com/liske/needrestart/commit/0f80a348883f72279a859ee655f58da34babefb0