Tainted flow: 'safe_output' from os.getenv (line 208, credential/environment) → shutil.copy (file write)
Medium
- Category
- Data Flow
- Content
import shutil safe_output = os.path.join(workspace_path, "outputs", os.path.basename(args.output)) os.makedirs(os.path.dirname(safe_output), exist_ok=True) shutil.copy(args.output, safe_output) args.output = safe_output print(f"Copied to allowed directory: {safe_output}")- Confidence
- 71% confidence
- Finding
- shutil.copy(args.output, safe_output)
