A vulnerability in needrestart before version 3.8 allows local attackers to execute arbitrary shell commands due to unsanitized data passed to the Modules::ScanDeps library. This flaw arises because the library expects safe input, but the application fails to sanitize it properly.