Back to skill

Security audit

Telegram Auto Topic

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims for Telegram topic creation, but it handles a powerful Telegram bot token in a way that can expose it locally.

Review before installing. Use a dedicated Telegram bot token, grant it only the permissions and groups needed for topic creation, protect the OpenClaw config file, and avoid running this on hosts where untrusted users or monitoring tools can read process command lines. Consider fixing the curl token handling before broad deployment.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/telegram-auto-topic.sh:35
Finding

Telegram Bot Token Exposed in Process Command-Line Arguments

Content
View full analysis
&2 exit 1 fi API="https://api.telegram.org/bot${BOT_TOKEN}" ``` The credential-bearing URL is then passed directly to `curl` for every Telegram API request: ```bash CREATE_RESULT=$(curl -s "$API/createForumTopic" \ -d "chat_id=${CHAT_ID}" \ --data-urlencode "name=${TITLE}") ``` ```bash SEND_RESULT=$(curl -s "$API/sendMessage" \ -d "chat_id=${CHAT_ID}" \ -d "message_thread_id=${TOPIC_ID}" \ --data-urlencode "text=${QUOTED}" \ -d "parse_mode=HTML") ``` ```bash FWD_RESULT=$(curl -s "$API/forwardMessage" \ -d "chat_id=${CHAT_ID}" \ -d "from_chat_id=${CHAT_ID}" \ -d "message_id=${MESSAGE_ID}" \ -d "message_thread_id=${TOPIC_ID}") ``` ### Technical Analysis The script reads the Telegram bot token from the OpenClaw configuration and embeds it in the Bot API URL. That URL is supplied to `curl` as a command-line argument. During request execution, the complete URL—including the bot token—may be visible through operating-system process inspection mechanisms such as `ps`, process-monitoring utilities, or `/proc//cmdline`, subject to the host's process-visibility and access-control settings. Shell tracing, process telemetry, or diagnostic tooling that records command arguments could also retain the credential. This is not a hardcoded credential, and exploitation requires sufficient local process-observation access. Nevertheless, passing a reusable secret in process arguments unnecessarily expands its exposure beyond the protected configuration file. ### Attack Path 1. The Skill receives a `/topic` request and invokes `telegram-auto-topic.sh`. 2. T ...[truncated 1525 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (10)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/telegram-auto-topic.sh <chat_id> <message_id> "<sender name>" "<title>" "<text after /topic>"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/telegram-auto-topic.sh <chat_id> <message_id> "<sender name>" "<title>" "<text after /topic>"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill instructs the agent to invoke a shell script but does not declare any explicit tool scope such as allowed-tools or permissions. That creates an avoidable trust gap: an agent may execute shell-capable actions without clear least-privilege boundaries, increasing the chance of command misuse or unsafe future modifications if untrusted message content is passed through the script path.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
name: telegram-auto-topic
description: >
  Add `/topic` to the start of any message in a Telegram forum group to
  auto-create a new topic from it. A title is generated automatically from
  the message content.
  Github: https://github.com/itstauq/telegram-auto-topic
metadata:

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/telegram-auto-topic.sh (reported line 43)May include surrounding context.

sh
exit 1
fi

API="https://api.telegram.org/bot${BOT_TOKEN}"

# ── arguments ───────────────────────────────────────────────────────
CHAT_ID="$1"

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/telegram-auto-topic.sh (reported line 88)May include surrounding context.

sh
TITLE=$(printf '%s' "$TITLE" | cut -c1-128)

# ── create forum topic ──────────────────────────────────────────────
CREATE_RESULT=$(curl -s "$API/createForumTopic" \
  -d "chat_id=${CHAT_ID}" \
  --data-urlencode "name=${TITLE}")

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/telegram-auto-topic.sh (reported line 109)May include surrounding context.

sh
QUOTED="<blockquote>${ESC_MSG}</blockquote>
— <b>${ESC_SENDER}</b>"

  SEND_RESULT=$(curl -s "$API/sendMessage" \
    -d "chat_id=${CHAT_ID}" \
    -d "message_thread_id=${TOPIC_ID}" \
    --data-urlencode "text=${QUOTED}" \

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/telegram-auto-topic.sh (reported line 121)May include surrounding context.

sh
fi
else
  # Media — forward to preserve attachments
  FWD_RESULT=$(curl -s "$API/forwardMessage" \
    -d "chat_id=${CHAT_ID}" \
    -d "from_chat_id=${CHAT_ID}" \
    -d "message_id=${MESSAGE_ID}" \

Excessive Permissions

Low
Category
Privilege Escalation
Confidence
80% confidence
Finding

Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.

Content

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

md
- **Attribution:** Quoted messages appear as sent by the bot (Telegram API limitation). Sender name is included as attribution text below the quote.
- **Media:** Forwarded media shows a "Forwarded from" header — best available but not native.
- **Forum groups only:** Won't work in regular groups or DMs.
- **Permissions:** Bot needs admin with Manage Topics.
- **Title length:** Telegram caps topic names at 128 characters.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes a skill that auto-creates Telegram topics from messages, but it does not mention reading local configuration files or extracting credentials. While Telegram API access is expected, coupling the skill to a specific local config path and bot-token retrieval adds a capability beyond the stated functional scope.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.