Tainted flow: 'model_status_file' from os.environ.get (line 45, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
model_status_dir = os.path.dirname(model_status_file) if model_status_dir and not os.path.exists(model_status_dir): os.makedirs(model_status_dir, exist_ok=True) with open(model_status_file, 'w') as f: f.write('loaded')- Confidence
- 95% confidence
- Finding
- The script allows the GENOS_STATUS_FILE environment variable or config value to control an arbitrary filesystem write path, then creates parent directories and writes to that path without validation. In environments where attackers can influence environment variables or configuration, this can overwrite or create unintended files, potentially affecting application behavior or corrupting local state.
