Tainted flow: 'saved_path' from pathlib.Path.read_bytes (line 1501, file read) → shutil.copy2 (file write)
Medium
- Category
- Data Flow
- Content
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") template_id = f"tpl_{timestamp}_{file_hash}" saved_path = self.user_template_dir / "templates" / f"{template_id}{template.suffix}" shutil.copy2(template, saved_path) content_type = self._infer_content_type_from_request(user_request) template_info = TemplateInfo(path=str(saved_path), style=StyleDefinition(), content_type=content_type, usage_count=1, last_used=datetime.now().isoformat()) self._update_registry(template_info)- Confidence
- 84% confidence
- Finding
- shutil.copy2(template, saved_path)
