Tainted flow: 'STATE_FILE' from os.environ.get (line 9, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
def _save_state(state): os.makedirs(os.path.dirname(STATE_FILE), exist_ok=True) with open(STATE_FILE, "w") as f: json.dump(state, f, ensure_ascii=False, indent=2)- Confidence
- 95% confidence
- Finding
- The state file path is taken directly from the LINKEDIN_LIKES_STATE environment variable and then used for directory creation and file writing without validation. If an attacker can influence the process environment, they can redirect writes to unintended filesystem locations, potentially overwriting user files or planting data in sensitive paths with the privileges of the running agent.
