Tainted flow: 'path' from os.getenv (line 29, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
"""保存开发者偏好记忆""" path = MEMORY_FILE.expanduser() path.parent.mkdir(parents=True, exist_ok=True) with open(path, "w", encoding="utf-8") as f: json.dump(data, f, ensure_ascii=False, indent=2) def get_task记忆(task_type):- Confidence
- 86% confidence
- Finding
- The memory file path is derived from an environment variable and then written without validation. If an attacker can influence MEMORY_PATH in the runtime environment, they can redirect writes to unintended files, causing arbitrary file overwrite within the privileges of the process and possible persistence or data corruption.
