T09 · Insecure Skill Coding Practices
- Location
scripts/update.sh:50- Finding
Arbitrary Shell Code Execution Through Notification Configuration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This OpenClaw updater is mostly coherent, but it needs review because its maintenance scripts make broad local changes and contain unsafe handling of secrets, temporary state, and global package rollback.
Install only if you are comfortable reviewing and hardening the shell scripts first. At minimum, avoid running rollback from untrusted /tmp state, do not source the Telegram env file as shell code, store update state under a private user-owned directory, validate npm rollback versions, and use a narrowly scoped Telegram bot token.
scripts/update.sh:50Arbitrary Shell Code Execution Through Notification Configuration
scripts/find-workspaces.sh:7JavaScript Code Injection Through OPENCLAW_CONFIG Path
scripts/pre-update.sh:34Predictable Shared Temporary Files Permit Disclosure, Tampering, and File Overwrite
scripts/rollback.sh:38Untrusted Rollback Version Controls Global npm Package Installation
scripts/update.sh:59Telegram Bot Token Exposed in Process Command-Line Arguments
This mismatch is more security-relevant because the skill introduces external Telegram API notification behavior and persistent secret loading that are not central to the declared updater purpose. Undeclared networked side effects and secret handling can surprise operators and expand the attack surface, especially when the skill is trusted as a local update helper.
This mismatch is more security-relevant because the skill introduces external Telegram API notification behavior and persistent secret loading that are not central to the declared updater purpose. Undeclared networked side effects and secret handling can surprise operators and expand the attack surface, especially when the skill is trusted as a local update helper.
This mismatch is more security-relevant because the skill introduces external Telegram API notification behavior and persistent secret loading that are not central to the declared updater purpose. Undeclared networked side effects and secret handling can surprise operators and expand the attack surface, especially when the skill is trusted as a local update helper.
The skill instructs the user to run multiple shell commands and scripts, but the manifest declares no explicit tool scope or allowed-tools. In an agent ecosystem, missing scope boundaries increases the chance the skill is invoked with broader shell access than intended, reducing enforceability of least privilege.
The skill instructs storing a long-lived Telegram bot token and chat ID in a persistent plaintext env file under ~/.openclaw. Persistent local secrets increase the risk of token theft via filesystem compromise, backup leakage, or accidental inclusion in logs or archives, and this skill also encourages external notifications that depend on that secret.
The update script sends success/failure notifications via Telegram Bot API (bypasses OpenClaw gateway, so it works even if the update breaks the gateway).
Create ~/.openclaw/.telegram-notify.env:
TELEGRAM_BOT_TOKEN=<your-bot-token>
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
```bash
chmod 600 ~/.openclaw/.telegram-notify.env
The bot token is the same one used by your OpenClaw Telegram channel. Chat ID can be found via openclaw directory.
The restore instructions perform overwriting operations on ~/.openclaw without an explicit confirmation, dry-run, or warning about data loss. In an update/recovery workflow, this can cause accidental destruction of current configuration or workspace state, especially if the backup path or timestamp is wrong.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
echo "Usage: bash rollback.sh [OPTIONS]"
echo ""
echo "Options:"
echo " --confirm Skip confirmation prompt and proceed"
echo " --help, -h Show this help"
exit 0
;;
The updater script includes Telegram notification behavior and credential handling that are not reflected in the stated skill scope, which broadens the trust boundary without clear disclosure. Hidden or under-documented outbound messaging in an updater is security-relevant because it can transmit operational metadata and conditions users to grant network access and secrets beyond what is needed for updates.
The script reads bot credentials from environment or a local env file and performs outbound network calls to Telegram, which is unrelated to the minimum mechanics needed to update software. This creates an unnecessary exfiltration-capable path from a privileged maintenance script and expands the consequences if the script, env file, or notification content are abused.
Use of the Telegram endpoint confirms third-party external transmission from the updater script. Even though the content appears limited to status messages, the skill context makes this more dangerous because update scripts often run with elevated trust and access, so any unnecessary egress channel increases exposure and the potential for future abuse or unnoticed data leakage.
notify() {
local msg="$1"
local result
result=$(curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d chat_id="${TELEGRAM_CHAT_ID}" \
-d text="${msg}" \
-d parse_mode="Markdown" 2>&1)
Use of the Telegram endpoint confirms third-party external transmission from the updater script. Even though the content appears limited to status messages, the skill context makes this more dangerous because update scripts often run with elevated trust and access, so any unnecessary egress channel increases exposure and the potential for future abuse or unnoticed data leakage.
notify() {
local msg="$1"
local result
result=$(curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d chat_id="${TELEGRAM_CHAT_ID}" \
-d text="${msg}" \
-d parse_mode="Markdown" 2>&1)
The notification text is hard-coded in Chinese, which forces a specific language for users receiving update messages. The file does not provide any opt-in, configuration, or justification for this locale restriction, so it appears to violate the language/locale policy requirement.
The failure alert text is written only in Chinese and does not offer an alternative language or user-controlled locale setting. Because this script emits user-facing operational messages, forcing a single language without opt-in is a policy concern.
Both success and unchanged-version Telegram messages use Chinese-only text, and the script contains no mechanism for users to choose their preferred language. This creates a natural-language locale policy violation for user-facing output.
No suspicious patterns detected.