auto-cleaning-disk
Audited by Socket on Mar 24, 2026
4 alerts found:
Obfuscated Filex4The script is a legitimate local disk-cleaning utility but is potentially dangerous due to irreversible deletions, suppressed errors, lack of dry-run/backup, and symlink/TOCTOU risks. It does not exhibit indicators of malware (no network exfiltration, no credential harvesting, no obfuscation). Recommendations: run only in Confirm mode; add a dry-run option and explicit logging of deleted paths; avoid running with elevated privileges; validate that targeted directories are not symlinks and verify ownership/permissions before deletion; remove broad except: blocks or at least log exceptions; avoid ignore_errors=True or capture and report failures.
This Python module is a straightforward Windows disk-cleaning utility that performs destructive filesystem operations (file and directory deletion and emptying the Recycle Bin). There is no evidence of network activity, covert exfiltration, or credential theft. The primary risk is accidental or inappropriate data loss due to broad target selection, lack of robust safeguards (dry-run, whitelists, backups), and pervasive exception suppression that hides failures. Treat it as a potentially harmful maintenance tool: require explicit user confirmation, add dry-run and logging, restrict targets to known cache directories (not entire profiles or system logs), validate paths derived from environment variables, and avoid emptying the Recycle Bin without an explicit step.
The code is a local disk-cleaning utility for macOS that performs destructive file and directory deletions across user and system locations. It is not malicious in terms of network exfiltration or backdoors, but it poses a real risk to data and system diagnostics if run without review or with elevated privileges. Notable issues: missing closing parenthesis (syntax error) prevents execution as provided; broad deletions, lack of dry-run/logging, and swallowing exceptions. Recommendations: fix syntax error; add dry-run mode, explicit logging of deleted paths, safer default (require confirmation), whitelist/limit targets, avoid deleting /var/log unless explicitly requested, and avoid running as root.
This file is a thin CLI wrapper that delegates actual disk-cleaning to OS-specific modules. The code shown does not exhibit direct malicious behaviors (no network exfiltration, no credential harvesting, no obfuscation techniques). The primary risks are: (1) destructive operations performed by the external clean_* modules (expected behavior for a cleaner), and (2) supply-chain/local-tampering risk via dynamic imports of the 'scripts' package (arbitrary code execution at import). The incomplete final line indicates the snippet may be truncated or buggy; review the OS-specific modules and packaging/integrity controls before trusting or running this tool. Use caution: do not run with elevated privileges or on critical systems without auditing the scripts package first.