disk-cleaner
Audited by Socket on Sep 21, 2026
3 alerts found:
Anomalyx3The code is intended to be a disk-cleaning tool and contains no evident malware or data-exfiltration behavior. It does include inherently destructive filesystem operations, especially with --force and --allow-unsafe-path, plus a potential local-module supply-chain trust issue and possible TOCTOU deletion race. As provided, syntax and runtime defects prevent execution. Review and fix the syntax/epilog errors, harden path validation against races, and restrict or carefully gate destructive operations before deployment.
This module is a destructive filesystem deletion utility (sync/async) that takes a list of `Path` objects and deletes files/directories via `unlink`/`rmtree` (or `send2trash`). There are no clear signs of covert malware (no networking, credential access, persistence, or obfuscation), but it can enable sabotage if untrusted input reaches `files` or if there are insufficient path-safety checks elsewhere. The `DELETE_SMART` strategy appears incomplete in the shown fragment, and async result accounting seems buggy, but the destructive sinks are real.
No direct evidence of covert malware (exfiltration, credential theft, persistence, network activity, or obfuscated payload execution) is present in this fragment. The primary security concern is operational risk: when auto_terminate=True, the module can force-kill processes (kill -9 / taskkill /F) associated with file locks determined from caller-supplied paths, using heuristic parsing of external command output. This can cause denial-of-service/disruption if file selection or upstream gating is weak. Confidence is moderate due to snippet truncation and reliance on external tool output/availability.