Tainted flow: 'LOG_FILE' from os.environ.get (line 10, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
def save_log(log): """保存记录。""" try: with open(LOG_FILE, 'w', encoding='utf-8') as f: json.dump(log, f, ensure_ascii=False, indent=2) except Exception: pass- Confidence
- 91% confidence
- Finding
- The script builds the log file path from the TEMP environment variable and then writes to it without validating or constraining the destination. In environments where an attacker can influence TEMP, this can redirect writes to unintended locations, enabling file clobbering, symlink abuse, or disclosure/modification of other files accessible to the process.
