T09 · Insecure Skill Coding Practices
- Location
src/operations/themes.py:31- Finding
Dry-run mode does not prevent destructive theme operations
- Content
View full analysis
Dict: """Create a duplicate of a theme for safe editing.""" source_theme = None themes = self.get_themes() for t in themes: if t['id'] == theme_id: source_theme = t break if not source_theme: raise ValueError(f"Theme not found: {theme_id}") new_name = name or f"{source_theme.get('name')} - AI Edit {self._timestamp()}" # Duplicate the theme new_theme = self.client.duplicate_theme(theme_id, new_name) self._working_theme_id = new_theme.get('id') # Audit log self.audit.log_change('theme', new_theme.get('id'), 'duplicate', {'source_theme_id': theme_id}, new_theme) return new_theme ``` ```python def publish_theme(self, theme_id: int, force: bool = False) -> Dict: """Publish a theme (make it live).""" themes = self.get_themes() theme = None for t in themes: if t['id'] == theme_id: theme = t break if not theme: raise ValueError(f"Theme not found: {theme_id}") if theme.get('role') == 'main': return {'message': 'Theme is already live'} # Require strong confirmation for publishing if not force: print(f"\n{'='*60}") print("⚠️ PUBLISH THEME - THIS WILL MAKE CHANGES LIVE") print(f"{'='*60}") print(f"Theme: {theme.get('name')}") print(f"Theme ID: {theme_id}") print(f"\nThis will replace your current live theme.") print("All visitors to your store will see these changes immediately.") print(f"\n{'='*60}") print("Type 'publish' to proceed, or anything else to cancel:") ...[truncated 3200 chars]- Remediation
View remediation
