T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:18
- Finding
- Telegram Bot Token Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 18; repeated in the example at line 49 **Vulnerability Type**: Plaintext credential exposure through command-line arguments **Risk Level**: Medium ### Vulnerable Code ```bash openclaw config set "channels.telegram.accounts.<bot名>.botToken" "<token>" ``` The same pattern appears in the complete example: ```bash openclaw config set "channels.telegram.accounts.judge.botToken" "8764559332:AAGxxx" ``` The example value is masked and is not evidence of an active credential. ### Technical Analysis The documented workflow instructs users to substitute a real Telegram bot token directly into a command-line argument. Depending on the operating environment, the token may be exposed through: - Shell history files. - Process listings or process inspection interfaces while the command is running. - Terminal session logging and command auditing. - Administrative monitoring or diagnostic tooling that records process arguments. A Telegram bot token is a bearer credential. Anyone who obtains it can authenticate to the Telegram Bot API as that bot without needing an additional password. Although the command stores the credential in the intended OpenClaw configuration, placing it directly on the command line unnecessarily expands the number of locations where the credential may be retained or observed. ### Attack Path 1. An operator replaces `<token>` with a real token issued by BotFather. 2. The operator executes the documented `openclaw config set` command. 3. The shell, an audit facility, terminal logging, or process inspection exposes or records the complete command. 4. A local user, compromised process, administrator, or log reader obtains the token. 5. The attacker uses the token to authenticate to the Telegram Bot API. 6. The attacker performs actions permitted to the bot, potentially including reading available updates, sending messages, changing supported bot settings, or impersonating the bo ...[truncated 778 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Provide a secret-aware configuration mechanism that reads the token from standard input, a protected file descriptor, or an approved secret manager without placing it in process arguments. 2. Use a non-echoing interactive prompt when supported by the `openclaw` command. 3. Ensure the resulting configuration file is owned by the intended service account and has restrictive permissions, such as owner-only read and write access. 4. Avoid publishing examples that encourage direct placement of credentials in shell commands. Use a secure placeholder workflow instead. 5. If command-line entry cannot be avoided, clearly warn users about shell history, process inspection, terminal recording, and audit-log exposure. Disabling history alone does not prevent process-argument disclosure. 6. Rotate the Telegram bot token immediately if it may have appeared in shared history, logs, screenshots, support bundles, or process-monitoring records. 7. Review and remove exposed command history and logs where operationally appropriate, while recognizing that deletion does not invalidate an already copied token. ]]>
