T02 · Agent Memory Poisoning
- Location
scripts/memory_store.py:35- Finding
Persistent Agent Memory Injection Through Unsanitized Stock Data
- Content
View full analysis
str: """存储一次分析记录""" stock_code = analysis_data.get('stock_code', 'unknown') stock_name = analysis_data.get('stock_name', '未知股票') timestamp = datetime.now() record = { "timestamp": timestamp.isoformat(), "date": timestamp.strftime("%Y-%m-%d"), "time": timestamp.strftime("%H:%M:%S"), "stock_code": stock_code, "stock_name": stock_name, "price": analysis_data.get('price'), "change_percent": analysis_data.get('change_percent'), "technical_signal": analysis_data.get('technical', {}).get('signal', 'unknown'), "sentiment": analysis_data.get('sentiment', {}).get('overall_sentiment', 'unknown'), "recommendation": analysis_data.get('recommendation', 'unknown'), "key_points": analysis_data.get('key_points', []) } today_file = self._get_today_file() self._append_to_daily_log(today_file, record) stock_memory_file = os.path.join(self.a_share_memory_dir, f"{stock_code}.json") self._append_to_stock_memory(stock_memory_file, record) self._update_session_state( ...[truncated 2534 chars]- Remediation
View remediation
