T09 · Insecure Skill Coding Practices
- Location
session_sync.py:73- Finding
Incomplete redaction exposes sensitive cross-session chat content in persistent shared storage
- Content
View full analysis
List[Dict]: """Parse message content""" messages = [] for line in content.strip().split('\n'): line = line.strip() if not line: continue try: msg = json.loads(line) # Sanitize content msg_content = msg.get("content", "") msg_content = sanitize_content(msg_content) messages.append({ "role": msg.get("role", "unknown"), "content": msg_content, "timestamp": msg.get("timestamp", "") }) except json.JSONDecodeError: continue return messages def sync_session(self, session_id: str) -> bool: """Synchronize one session""" content = self.get_session_content(session_id) if not content: return False # Check for changes if not self.detector.has_changed(session_id, content): return False # Parse messages messages = self.parse_messages(content) if not messages: return False # Build session data session_data = { "id": session_id, "timestamp": datetime.now().isoformat(), "hash": self.detector.calculate_hash(content), "message_count": len(messages), "messages": messages[-50:] } # Write files self.file_manager.append_json(session_data) self.file_manager.append_markdown(session_data) ``` ## ...[truncated 2455 chars]- Remediation
View remediation
