other
- Location
scripts/analyzer.py:58- Finding
Automated Profiling of Persistent Conversation Memory
- Content
View full analysis
Vulnerability Details
File Location:
scripts/analyzer.py:58-139; related behavior inscripts/heartbeat_tracker.py:39-49, 78-124and automatic execution guidance inSKILL.md:12-15, 19-27, 56-59
Vulnerability Type: Privacy-sensitive Agent memory profiling
Risk Level: MediumVulnerable Code
python def extract_from_memory(date_str=None): """从记忆文件提取信息""" if date_str is None: date_str = datetime.now().strftime("%Y-%m-%d") memory_file = MEMORY_DIR / f"{date_str}.md" if not memory_file.exists(): return None with open(memory_file, 'r') as f: content = f.read().lower() found = {"topics": [], "projects": [], "skills": []} for kw in KEYWORDS["topics"]: if kw.lower() in content: found["topics"].append(kw) for kw in KEYWORDS["projects"]: if kw.lower() in content: found["projects"].append(kw) for kw in KEYWORDS["skills"]: if kw.lower() in content: found["skills"].append(kw) return found def analyze(days=7): """分析最近N天的行为""" results = { "topics": [], "projects": [], "skills": [], "dates": [] } for i in range(days): date = datetime.now() - timedelta(days=i) date_str = date.strftime("%Y-%m-%d") found = extract_from_memory(date_str) if found: results["topics"].extend(found["topics"]) results["projects"].extend(found["projects"]) results["skills"].extend(found["skills"]) results["dates"].append(date_str) return results def update_patterns(analysis): """更新行为模式""" data = load_behavior_data() if "skills" not in data: data["skills"] = {} if "active_hours" not in data: data["active_hours"] = {} ...[truncated 3650 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit, informed opt-in before reading any persistent conversation-memory file.
- Default to manual analysis of user-selected files or explicitly supplied conversation summaries rather than scanning the workspace automatically.
- Clearly disclose every collected field, the analysis period, storage location, retention period, and intended use before activation.
- Provide controls to disable tracking, inspect collected data, reset counters, and securely delete all generated profiles.
- Minimize collection by omitting activity hours, skill usage, and project identifiers unless the user specifically requests those dimensions.
- Apply a short retention period and avoid indefinite cumulative aggregation.
- Create profile and report files with owner-only permissions, and verify that the target workspace is trusted before reading or writing.
- Validate and constrain
OPENCLAW_WORKSPACEso an inherited or manipulated environment variable cannot silently redirect analysis to an unintended directory. - Modify heartbeat processing to track the previously processed content boundary or a content hash. Process only new material rather than recounting every keyword whenever the file size changes.
- Keep automatic scheduling disabled by default and require a separate, explicit user action to enable recurring analysis.
