Tainted flow: 'LOG_FILE' from os.environ.get (line 11, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
"sodium_mg": sodium_mg, "extra_nutrients": json.dumps(extra_nutrients) if extra_nutrients else "", } with open(LOG_FILE, "a", newline="") as f: writer = csv.DictWriter(f, fieldnames=FIELDNAMES) writer.writerow(row) return row- Confidence
- 90% confidence
- Finding
- The log path is taken directly from the FOOD_LOG environment variable and then opened for append without validation. If an attacker can influence the process environment, they can redirect writes to unintended filesystem locations, causing arbitrary file creation or modification within the permissions of the running process.
