gmail
Audited by Socket on Feb 16, 2026
1 alert found:
SecurityThis module implements a local filesystem cache for Gmail-related data and contains no clear signs of intentional malware (no network exfiltration, no code injection, no hardcoded secrets). However, it has security issues: it fails to validate or sanitize 'account' and 'message_id' inputs and allows absolute paths or traversal segments when constructing file system paths. This can lead to accidental or malicious deletion or modification of files outside the intended cache directory (via unlink or shutil.rmtree) and other filesystem-level attacks (symlink/TOCTOU). Recommend sanitizing inputs (reject path separators and absolute paths, canonicalize and verify paths remain under cache_dir), use atomic writes (write-to-temp + rename), handle I/O exceptions explicitly, and consider file permissions and protections. Use caution if running in an environment where 'account' or message identifiers may be attacker-controlled or when GMAIL_CACHE_DIR can be set by untrusted actors.