T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/endo/endo-check.sh:13
- Finding
- Direct Access to Agent Memory and Cross-Skill State<![CDATA[ ## Vulnerability Details **File Location**: `scripts/endo/endo-check.sh`, lines 13–43 **Vulnerability Type**: Direct access to persistent Agent data outside a narrowly scoped telemetry interface **Risk Level**: Medium ### Complete Code Snippet ```bash # 获取当前token使用率(估算) get_token_usage() { local memory_file="/root/.openclaw/workspace/memory/$(date +%Y-%m-%d).md" if [ -f "$memory_file" ]; then local chars=$(wc -c < "$memory_file") local estimated=$((chars * 2)) # 粗略估算 echo $estimated else echo 0 fi } # 获取活跃任务数 get_active_tasks() { local task_file="/root/.openclaw/workspace/.dream/task-state.json" if [ -f "$task_file" ]; then local count=$(grep -c '"status":"active"' "$task_file" 2>/dev/null) [ -z "$count" ] && count=0 echo $count else echo 0 fi } # 获取对话轮数 get_turn_count() { local memory_file="/root/.openclaw/workspace/memory/$(date +%Y-%m-%d).md" if [ -f "$memory_file" ]; then grep -c "^## " "$memory_file" 2>/dev/null || echo 0 else echo 0 fi } ``` ### Technical Analysis The script directly opens the Agent's daily persistent memory file and another Skill's task-state file. Although the current implementation only calculates file-size, heading-count, and active-task metrics, it crosses component boundaries instead of using a dedicated, least-privilege telemetry interface. The hard-coded `/root/.openclaw/workspace` paths also assume execution in a privileged account's workspace. If the Skill is invoked with access to that workspace, it can inspect metadata derived from persistent Agent activity and from another Skill's state. The current code does not transmit the underlying contents and does not provide a direct mechanism for obtaining additional operating-system privileges. ### Attack Path 1. The Skill is invoked in an environment where it can read `/root/.openclaw/workspace`. 2. `get_token_usage` opens the current da ...[truncated 1234 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace direct memory-file access with a dedicated telemetry interface that returns only approved aggregate values. 2. Store task metrics in an Endo-specific input file rather than scanning another Skill's private state. 3. Require explicit authorization before inspecting persistent Agent memory or cross-Skill state. 4. Apply filesystem permissions that restrict each Skill to its own state directory. 5. Avoid hard-coded `/root` paths. Resolve an explicitly configured, nonprivileged workspace and validate it before use. 6. Run the Skill under a dedicated unprivileged account with access only to the telemetry and state files required for its function. 7. Document every cross-Skill data dependency and define a stable schema containing no conversation content or unnecessary metadata. ]]>
