Back to skill

Security audit

Telegram Ops

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches Telegram forum management, but it needs review because it exposes Telegram bot tokens in shell commands and makes new Telegram topic sessions inherit all installed skills by default.

Review this before installing in any OpenClaw environment with powerful skills or sensitive integrations. Use a narrow skills allowlist for each Telegram topic, avoid passing real bot tokens as command-line arguments, keep the bot limited to only the groups and permissions it needs, validate topic names and IDs before running the scripts, and verify archived session exports before deleting session history.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/create_topic.sh:2
Finding

Telegram Bot Token Exposed Through Process Arguments and Request URLs

Content
View full analysis
[emoji_id] set -e TOKEN="$1" CHAT_ID="$2" NAME="$3" EMOJI_ID="$4" ``` ```bash RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \ -H "Content-Type: application/json" \ -d "{ ``` ```bash EDIT_RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/editForumTopic" \ -H "Content-Type: application/json" \ -d "{ ``` `scripts/archive_topic.sh:7-14, 32-34, 52-54`: ```bash # Usage: ./archive_topic.sh set -e TOKEN="$1" CHAT_ID="$2" TOPIC_ID="$3" CURRENT_NAME="$4" ``` ```bash EDIT_RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/editForumTopic" \ -H "Content-Type: application/json" \ -d "{ ``` ```bash CLOSE_RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/closeForumTopic" \ -H "Content-Type: application/json" \ -d "{ ``` `SKILL.md:12-16`: ```bash - Get the bot token from OpenClaw config: ```bash gateway action=config.get | jq -r '.result.parsed.channels.telegram.botToken' ``` ``` ### Technical Analysis Both scripts require the Telegram bot token as the first command-line argument. Command-line arguments can be retained in shell history and may be visible through process inspection, audit systems, debugging output, terminal recording, or command telemetry. The token is subsequently embedded directly in the Telegram API URL passed to `curl`. As a result, the token can also appear in the `curl` process argument list and in diagnostic or URL-level logging. Although sending the token to the officia ...[truncated 1697 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create_topic.sh:22
Finding

Unsafe JSON Construction Using Unvalidated Shell Arguments

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:21
Finding

Topic Sessions Default to All Installed Skills Instead of a Least-Privilege Allowlist

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (17)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill includes shell commands and operational actions but does not declare any explicit tool scope or permissions boundary. In an agent environment, this can lead to overbroad execution capability, making it easier for the skill to invoke shell access or adjacent tools without clear authorization review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs operators to retrieve a Telegram bot token from configuration and then use it in shell commands, but provides no warning about credential sensitivity, redaction, logging exposure, or least-privilege handling. A bot token grants control of the bot and could be leaked through shell history, transcripts, copied commands, or agent logs.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

Step 1: Create via Bot API

bash
curl -X POST "https://api.telegram.org/bot<TOKEN>/createForumTopic" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": <GROUP_ID>,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The archiving section documents deletion of OpenClaw session state and transcript artifacts without a strong warning about irreversibility, validation, or confirmation. This creates a real risk of accidental loss of operational history, audit trail, and recovery context, especially because deletion is paired closely with an export step that may fail or produce incomplete backups.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/emoji-ids.md (reported line 127)May include surrounding context.

Usage

bash
curl -X POST "https://api.telegram.org/bot<TOKEN>/editForumTopic" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": <GROUP_ID>,

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/archive_topic.sh (reported line 34)May include surrounding context.

sh
# Step 1: Rename and set folder icon
echo "Setting archived name and folder icon..."
EDIT_RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/editForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/create_topic.sh (reported line 42)May include surrounding context.

sh
# Step 1: Rename and set folder icon
echo "Setting archived name and folder icon..."
EDIT_RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/editForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/archive_topic.sh (reported line 53)May include surrounding context.

sh
# Step 2: Close the topic
echo "Closing topic..."
CLOSE_RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/closeForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 44)May include surrounding context.

md
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 95)May include surrounding context.

md
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/emoji-ids.md (reported line 127)May include surrounding context.

md
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/archive_topic.sh (reported line 34)May include surrounding context.

sh
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/archive_topic.sh (reported line 53)May include surrounding context.

sh
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/create_topic.sh (reported line 22)May include surrounding context.

sh
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/create_topic.sh (reported line 42)May include surrounding context.

sh
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/create_topic.sh (reported line 22)May include surrounding context.

sh
fi

# Create the topic
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${TOKEN}/createForumTopic" \
    -H "Content-Type: application/json" \
    -d "{
        \"chat_id\": ${CHAT_ID},

Static analysis

Detected: suspicious.prompt_injection_instructions

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
SKILL.md:56