gmail-cleaner
Audited by Socket on Sep 23, 2026
6 alerts found:
Anomalyx5SecurityThe code is a transparent Gmail bulk-cleaning tool, not evidently malware. Its intended behavior is destructive but explicitly controlled by command-line options and includes a dry-run mode. The main security risks are unsafe pickle deserialization of the token file, local storage of sensitive OAuth credentials, automatic shell-based pip installation, and the possibility of accidental or irreversible message deletion through broad queries. No covert exfiltration or backdoor behavior is evident in the supplied fragment.
The code implements legitimate Gmail OAuth authentication and contains no clear malicious behavior or exfiltration. The main security risk is unsafe deserialization of the token file with pickle, which permits arbitrary code execution if the file is attacker-controlled or tampered with. It also stores sensitive OAuth credentials without explicitly enforcing restrictive permissions and installs dependencies dynamically through os.system. Replace pickle with a safer credential format or validate the file origin and permissions, use subprocess with fixed arguments for installation if runtime installation is unavoidable, and protect the token file.
The code appears to be a Gmail cleanup utility rather than malware. It does not show data exfiltration, credential harvesting beyond intentionally loading the configured Gmail token, persistence, or remote-control behavior. It is operationally risky because destructive actions are enabled by default, including permanently purging trash, and because pickle deserialization can execute arbitrary code if the token file is attacker-controlled. The token file should be protected and dry-run or explicit confirmation should be used before execution.
The code appears to be a Gmail trash-restoration utility, not intentional malware. The main security risk is unsafe pickle deserialization of the token file: compromise or replacement of that file could cause arbitrary code execution when the script runs. Automatic dependency installation is an additional supply-chain and operational concern. The Gmail modification behavior is destructive or consequential but matches the stated purpose and is controlled by the authenticated user's search query.
The code appears to be a Gmail organization utility rather than malware. It performs privileged Gmail label and filter operations as intended and contains no evident data exfiltration or backdoor behavior. Security review is warranted because pickle.load can execute arbitrary code from a tampered token file, and the fallback os.system pip installation introduces dependency and command-execution risk. The configured Gmail queries and filters should be reviewed before execution, and the token file must be trusted and access-controlled.
The code is a Gmail inbox reporting utility with one significant security issue: unsafe deserialization of a user-selected pickle file. A malicious or tampered token file could execute arbitrary code with the user's privileges. Automatic pip installation is an additional supply-chain and environment-modification concern, though the command uses fixed package names and no clear malicious behavior is evident. The Gmail data remains in the intended API flow and is printed locally. The token file should be trusted, access-controlled, and preferably replaced with a non-executable credential format or safe validation process.