T09 · Insecure Skill Coding Practices
Warning
- Location
- references/cli-cheatsheet.md:17
- Finding
- Telegram Bot Token Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `references/cli-cheatsheet.md`, line 17 **Vulnerability Type**: Secret exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```bash openclaw channels add --channel telegram --token <bot-token> ``` ### Technical Analysis The documented command instructs users to provide a Telegram bot token directly as a command-line argument. When the placeholder is replaced with an actual token, the secret can be exposed through: - Shell history files if the command is entered interactively. - Process inspection utilities while the command is running. - Operating-system auditing and endpoint-monitoring logs. - Terminal session recording or command telemetry. - Diagnostic output that captures the invoked command. Command-line arguments are not an appropriate secret-transfer mechanism because they may be observable by systems and principals other than the intended process. ### Attack Path 1. An administrator follows the documented procedure and replaces `<bot-token>` with a valid Telegram bot token. 2. The command containing the token is recorded in shell history, terminal telemetry, audit logs, or process information. 3. A local user, support operator, monitoring service, or attacker with access to those records retrieves the token. 4. The attacker uses the token against the Telegram Bot API. 5. The attacker can impersonate or operate the affected bot within the permissions and functionality granted to that bot. ### Impact Assessment Exposure grants control associated with the compromised Telegram bot token. Depending on the bot configuration, an attacker may send messages as the bot, inspect available bot updates, disrupt legitimate operation, or interact with OpenClaw workflows connected to the bot. The impact is limited to the affected bot and any downstream systems that trust its messages, but those downstream integrations may expand the practical scope. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions - Prefer a protected token file supported by the CLI, with ownership restricted to the OpenClaw service account and permissions set to `0600`. - If available, use an interactive secret prompt that disables terminal echo. - Alternatively, pass the token through standard input without including it in the process argument list. - Clearly warn users not to enter bot tokens directly into commands that may be retained in shell history. - Document secure token rotation procedures. - After suspected exposure, revoke the existing Telegram token, generate a replacement, update the protected credential source, and remove the old command from shell history and relevant logs where feasible. ]]>
