T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- SKILL.md:189
- Finding
- Direct Access to Telegram Bot Credentials Bypasses the Protected Messaging Abstraction<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:189-220` **Vulnerability Type**: Least-privilege violation and direct credential access **Risk Level**: High ### Vulnerable Code ```bash TOKEN=$(cat ~/.openclaw/secrets.json | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('telegram',{}).get('botToken',''))") # Send photo curl -s \ -F "chat_id=CHAT_ID" \ -F "photo=@$HOME/.openclaw/workspace/runpod-media/OUTPUT_FILE.jpg" \ -F "caption=YOUR CAPTION" \ "https://api.telegram.org/bot${TOKEN}/sendPhoto" # Send video (.mp4) curl -s \ -F "chat_id=CHAT_ID" \ -F "video=@$HOME/.openclaw/workspace/runpod-media/OUTPUT_FILE.mp4" \ -F "caption=YOUR CAPTION" \ "https://api.telegram.org/bot${TOKEN}/sendVideo" ``` The instructions further direct the agent to use this mechanism when the normal messaging abstraction fails: ```markdown Try it first — if it works, great. If it returns a SecretRef error, fall back to the curl method above. ``` ### Technical Analysis The Skill's declared media-generation functionality requires RunPod and Cloudflare R2 credentials. It does not inherently require direct access to the Telegram bot token. These instructions explicitly tell the agent to read an unrelated high-value credential from the global OpenClaw secrets file and use it through a shell command. This bypasses the platform's `message` tool and its SecretRef isolation specifically when sandboxed credential resolution prevents delivery. The bot token is interpolated into the curl URL. Consequently, it can become visible through process-command inspection, shell tracing, diagnostic tooling, or error collection. Direct API access also removes policy and validation controls that the platform messaging abstraction may otherwise enforce. ### Attack Path 1. A user requests image or video generation. 2. The Skill creates the requested media. 3. Delivery through the normal `message` tool fails or is represented as having failed with a Sec ...[truncated 845 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the direct `secrets.json` access and curl-based Telegram fallback from `SKILL.md`. 2. Deliver media exclusively through the platform-provided `message` tool. 3. If sandbox-compatible delivery is required, implement a trusted platform broker that accepts a media reference without exposing the Telegram token to the Skill. 4. Restrict the Skill manifest to the RunPod and R2 secrets necessary for generation and temporary uploads. 5. Ensure messaging credentials never appear in shell arguments, logs, diagnostics, environment variables inherited by child processes, or generated instructions. 6. Treat a SecretRef failure as a delivery error rather than authorization to bypass the isolation mechanism. ]]>
