Tainted flow: 'cache_file' from os.environ.get (line 416, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
p(f" 本周运动: 中强度 {result.get('weekly_moderate_minutes')}min 高强度 {result.get('weekly_vigorous_minutes')}min / 目标 {result.get('weekly_intensity_goal')}min") # ── 保存 JSON ────────────────────────────── with open(cache_file, "w", encoding="utf-8") as f: json.dump(result, f, ensure_ascii=False, indent=2) if target_date == str(date.today()):- Confidence
- 87% confidence
- Finding
- The output path is derived from GARMIN_DATA_DIR, which is environment-controlled, and the script writes highly sensitive health data to that location without validating or constraining the destination. In an agent or automation context, a manipulated environment could redirect writes to unintended files or shared locations, causing privacy leakage or clobbering of user data.
