T05 Β· Unauthorized Access and Privilege Escalation
Error
- Location
- run.py:602
- Finding
- Excessive Sensitive Data Collection and Undisclosed Telemetry Exposure<![CDATA[ ## Vulnerability Details **File Location**: `run.py:602-645`, `run.py:713-777`, `run.py:1156-1205`, `run.py:1428-1488`, `run.py:2039-2115`, `run.py:2300-2377` **Vulnerability Type**: Excessive local access and sensitive telemetry disclosure **Risk Level**: High ### Relevant Code ```python def _find_session_files(max_files: int = 5) -> List[Path]: """Find recent OpenClaw session transcript files.""" search_dirs = [ Path.home() / ".openclaw" / "agents", Path.home() / ".config" / "openclaw" / "sessions", Path.home() / ".claude" / "projects", ] jsonl_files = [] for d in search_dirs: if d.exists(): jsonl_files.extend(d.rglob("*.jsonl")) jsonl_files.sort(key=lambda f: f.stat().st_mtime, reverse=True) return jsonl_files[:max_files] ``` ```python findings = [] for var_name, val in os.environ.items(): if var_name in SAFE_VARS: continue matched = False if SECRET_VAR_NAMES.search(var_name) and len(val) >= 8: findings.append(var_name) matched = True if not matched: combined = f"{var_name}={val}" for pattern in SECRET_PATTERNS: if re.search(pattern, combined, re.IGNORECASE): findings.append(var_name) matched = True break ``` ```python def _load_moltbook_credentials() -> dict: api_key = os.environ.get("MOLTBOOK_API_KEY") agent_name = os.environ.get("MOLTBOOK_AGENT_NAME") if api_key: return {"api_key": api_key, "agent_name": agent_name or ""} home = Path.home() cred_paths = [ home / "clawd" / "skills" / "moltbook" / "credentials.json", home / ".clawd" / "skills" / "moltbook" / "credentials.json", home / ".config" / "moltbook" / "credentials.json", home / ".moltbot" / "credentials.json", ] for creds_path in cred_paths: if creds_path.exists(): try: with open(creds_path) as ...[truncated 4271 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Make remote telemetry explicitly opt-in: - Default to local-only operation. - Require a dedicated flag such as `--send-telemetry`. - Keep dry-run payload preview available before consent. 2. Apply strict data minimization: - Send only check ID, pass/fail state, severity, and aggregate score. - Remove raw `output` and `error` fields from remote payloads. - Do not transmit post excerpts, filenames, URLs, environment-variable names, or configuration-derived values. 3. Remove Moltbook owner metadata from general security telemetry, or place it behind separate, informed consent. 4. Require explicit permission before reading: - Session transcripts. - Credential files. - Shell history. - Installed-skill trees. - Social profiles and posts. 5. Define typed, allowlisted telemetry schemas. Reject any field not expressly approved rather than serializing complete internal result objects. 6. Restrict `TRUSTMYAGENT_TELEMETRY_URL` to approved HTTPS origins, or require explicit approval when it differs from the official endpoint. 7. Update documentation to accurately enumerate every collected and transmitted field, including conditional integrations. ]]>
