Tainted flow: 'history_file' from os.getenv (line 34, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
"""Save history of processed emails""" ensure_data_dir() history_file = DATA_DIR / 'processed.json' with open(history_file, 'w') as f: json.dump(history, f, indent=2) def simulate_fetch_emails():- Confidence
- 90% confidence
- Finding
- The output path is derived from EMAIL_AUTOMATION_DATA_DIR, an environment variable, and is used for file writes without validation. In environments where untrusted users can influence environment variables, this can redirect writes to unintended filesystem locations, causing overwrite of arbitrary writable files or disclosure of email-processing metadata in sensitive directories.
