T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- notify.py:205
- Finding
- Excessive Collection and Transmission of Agent Conversation Data<![CDATA[ ## Vulnerability Details **File Location**: `notify.py:205-212`, `notify.py:271-282`, `notify.py:389-400`, and `notify.py:469-480` **Vulnerability Type**: Excessive access to conversation records and transmission to an unrestricted endpoint **Risk Level**: High ### Vulnerable Code ```python ADAPTERS = { "claude-code": {"glob": "~/.claude/projects/*/*.jsonl", "parse": _parse_claude}, "hermes": {"glob": "~/.hermes/sessions/session_*.json", "parse": _parse_hermes}, "codex": {"glob": "~/.codex/sessions/**/*.jsonl", "parse": _parse_jsonl_generic}, "openclaw": {"glob": "~/.openclaw/sessions/**/*.json*", "parse": _parse_jsonl_generic}, } ``` ```python ws = await asyncio.wait_for( websockets.connect(cfg["url"], proxy=cfg.get("proxy")), timeout ) hello = { "mac": cfg["device_id"], "code": cfg["auth_code"], "agent": cfg.get("agent", "unknown"), "host": os.uname().nodename, "v": 1, } await ws.send(json.dumps(hello)) ``` ```python for ev in changed: await ws.send(json.dumps(ev)) _log(f"推送 {ev['status']} | {ev['text']}") ``` ```python return { "type": "task_status", "agent": agent, "task": task, "status": status, "time": dt.isoformat(timespec="seconds"), "detail": detail, "text": TEMPLATE.format( agent=AGENT_CN.get(agent, agent), task=task, status=STATUS_CN.get(status, status), time=_spoken_time(dt), ), } ``` ### Technical Analysis The daemon recursively monitors session records belonging to supported AI agents and extracts recent user text as the task name. It then sends the extracted task text, task state, timestamp, agent identity, hostname, device identifier, and authorization code to the WebSocket URL supplied during setup. The destination is not restricted through an allowlist, trust policy, or certificate-pinning mechanism. There is also no content redaction or option to exclude task text from notifications. Although transmission is part of ...[truncated 1699 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Make transcript monitoring an explicit, separate opt-in capability rather than enabling it implicitly with daemon startup. 2. Default to manual notifications or status-only messages that do not contain conversation text. 3. Allow users to select the exact agent, project, and session files that may be monitored. 4. Display a clear confirmation identifying the directories read and the fields transmitted before starting the daemon. 5. Add a configuration option to omit `task`, `detail`, hostname, device identifier, and other unnecessary metadata. 6. Implement secret and sensitive-data redaction before constructing network payloads. 7. Restrict notification destinations through an approved-host policy or require explicit confirmation when the hostname changes. 8. Support certificate pinning or another strong endpoint-authentication mechanism for managed deployments. 9. Provide a preview mode showing the exact outbound payload before persistent monitoring begins. ]]>
