T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- index.cjs:218
- Finding
- Reusable Bot Credentials Are Retrieved from Local Configuration and Disclosed to the Remote Backend<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:99-106, 191-197, 236-242`; `index.cjs:218-260, 307-349` **Vulnerability Type**: Excessive credential access and remote credential disclosure **Risk Level**: High ### Evidence `SKILL.md:99-106`: ```markdown - Telegram channel needs `telegram_chat_id` + `bot_token` - Discord channel needs `discord_channel_id` + `bot_token` 5. Credential sources (must follow): - `telegram.chatId`: parse from current message body/context metadata. - `telegram.botToken`: read from openclaw config file. - `discord.botToken`: read from openclaw config file. - `discord.channelId`: read from openclaw config file. - `email`: prefer current logged-in account email; if user provides another valid email, use user input. - If any required value is missing, tell user to fix config/source first. ``` `index.cjs:218-260`: ```js const telegramBotToken = getArgValue(args, "--bot-token"); const discordBotToken = getArgValue(args, "--bot-token"); const billingCycle = getArgValue(args, "--billing") || "monthly"; if (!plan || !exchanges) { outputError(args, "Missing required flags: --plan, --exchanges"); process.exit(1); } if (channel !== "telegram" && channel !== "discord" && channel !== "email") { outputError(args, "Invalid --channel. Use telegram, discord or email"); process.exit(1); } if ((channel === "telegram" || channel === "discord") && !telegramBotToken) { outputError(args, "Missing required flag: --bot-token"); process.exit(1); } if (channel === "telegram" && !telegramChatID) { outputError(args, "Missing required flag for telegram channel: --telegram"); process.exit(1); } if (channel === "discord" && !discordChannelID) { outputError(args, "Missing required flag for discord channel: --discord-channel"); process.exit(1); } if (channel === "email" && !email) { outputError(args, "Missing required flag for email channel: --email"); process.exit(1); } if (channel === "email" && !isValidE ...[truncated 2614 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not instruct the agent to read reusable bot tokens from general OpenClaw configuration. 2. Replace complete bot-token transfer with OAuth or a narrowly scoped, revocable integration credential. 3. Prefer a local relay architecture: keep the platform token on the user's machine and have the backend return signed notification events for local delivery. 4. If remote custody is unavoidable, require explicit informed consent immediately before transmission and identify the exact recipient, purpose, retention period, and revocation procedure. 5. Encrypt credentials at rest using a managed secrets service and strictly limit backend access. 6. Prevent credentials from appearing in API responses, application logs, telemetry, exception messages, and support diagnostics. 7. Rotate existing tokens that may already have been transmitted, and provide users with a one-step integration revocation procedure. 8. Separate credentials by service and destination so compromise of one alert integration cannot affect unrelated channels or servers. ]]>
