Back to skill

Security audit

Tg Notify

Security checks for vulnerabilities and agentic risk

Overview

This Telegram notification skill does what it claims, but it uses a local bot credential and unsafe shell templates to send external messages, so users should review it carefully before installing.

Install only if you trust the OpenClaw Telegram bot setup and are comfortable with message text and chat IDs being sent to Telegram. Before use, prefer replacing the shell snippets with a small Node sender that validates chat IDs, JSON-serializes message bodies, avoids shell interpolation, and asks for confirmation before new or multiple recipients.

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

Error
Location
SKILL.md:20
Finding

Shell Command Injection Through Unsafe Message and Recipient Interpolation

Content
View full analysis
", "text": "", "parse_mode": "HTML" }' ``` ```bash BOT_TOKEN=$(node -e "const c=require(process.env.HOME+'/.openclaw/openclaw.json');console.log(c.channels.telegram.botToken)") for CHAT_ID in 111111111 222222222; do curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \ -H "Content-Type: application/json" \ -d "{\"chat_id\": \"${CHAT_ID}\", \"text\": \"\", \"parse_mode\": \"HTML\"}" done ``` ### Technical Analysis The Skill instructs an agent to substitute recipient identifiers and message content directly into shell command templates. These values can originate from user requests and are not validated or encoded before being placed into shell syntax. In the first example, the JSON body is enclosed in single quotes. A message containing a single quote can terminate that quoted argument and introduce additional shell operators or commands. In the multiple-recipient example, the JSON body is enclosed in double quotes. If attacker-controlled content is inserted into the generated command, shell constructs such as `$(...)`, backticks, quotes, backslashes, and command separators can be interpreted during shell parsing rather than treated solely as Telegram message data. JSON escaping alone is insufficient because the data first passes through the shell parser. A dedicated JSON serializer must be used while keeping untrusted values out of generated shell source. ### Attack Path 1. An attacker a ...[truncated 1334 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

YARA rule 'agent_skill_credential_exfiltration_webhook': AI agent skill credential harvesting followed by webhook or external exfiltration [agent_skills]

Critical
Category
YARA Match
Confidence
91% confidence
Finding

The YARA hit is driven by a risky pattern: reading a credential from a local configuration file and using it in curl requests to an external endpoint. Although the visible purpose is benign notification, this structure is dangerous because the same mechanism can silently transmit sensitive content off-system, and the skill lacks guardrails or explicit warnings around that capability.

Content

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

] via telegram", "ping [person] on telegram", "отправь уведомление", "уведоми". metadata: {"clawdbot":{"emoji":"📨","requires":{"bins":["curl","node"]}}}

Telegram Notify Skill

Send messages to any Telegram user by chat ID using the OpenClaw bot.

Bot Token

Read dynamically from openclaw.json — never hardcode:

bash
BOT_TOKEN=$(node -e "const c=require(process.env.HOME+'/.openclaw/openclaw.json');console.log(c.channels.telegram.botToken)")

Send a Message

bash
BOT_TOKEN=$(node -e "const c=require(process.env.HOME+'/.openclaw/openclaw.json');console.log(c.channels.telegram.botToken)")

curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "<TELEGRAM_USER_ID>",
    "text": "<MESSAGE>",
    "parse_mode": "HTML"
  }'

Send to Multiple Recipients

bash
BOT_TOKEN=$(node -e "const c=require(process.env.HOME+'/.openclaw/openclaw.json');console.log(

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

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

md
# Telegram Notify Skill

Send messages to any Telegram user by chat ID using the OpenClaw bot.

## Bot Token

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to activate on common language such as 'notify' or 'alert', which can cause the skill to run in situations the user did not specifically intend. In this skill, unintended activation is more dangerous because execution leads directly to outbound messaging through Telegram using a locally stored bot credential.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill reads a bot token from a local secrets file and immediately uses it to send data to an external service, but it does not present an explicit warning or consent boundary about credential use and external transmission. That combination increases the chance that users or higher-level agents invoke it without understanding that message contents and recipient identifiers will be sent to Telegram.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The explicit use of api.telegram.org confirms that data is sent to an external third-party service. In context this is expected behavior, but it remains a real data egress path and should be treated as such.

Content

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

bash
BOT_TOKEN=$(node -e "const c=require(process.env.HOME+'/.openclaw/openclaw.json');console.log(c.channels.telegram.botToken)")

curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "<TELEGRAM_USER_ID>",

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The explicit use of api.telegram.org confirms that data is sent to an external third-party service. In context this is expected behavior, but it remains a real data egress path and should be treated as such.

Content

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

bash
BOT_TOKEN=$(node -e "const c=require(process.env.HOME+'/.openclaw/openclaw.json');console.log(c.channels.telegram.botToken)")

curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "<TELEGRAM_USER_ID>",

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The loop enables bulk outbound transmission to multiple recipients, increasing the blast radius of any mistaken or malicious invocation. In a notification skill this is functional, but it makes accidental disclosure or spam more impactful than a single-recipient send.

Content

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

md
BOT_TOKEN=$(node -e "const c=require(process.env.HOME+'/.openclaw/openclaw.json');console.log(c.channels.telegram.botToken)")

for CHAT_ID in 111111111 222222222; do
  curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
    -H "Content-Type: application/json" \
    -d "{\"chat_id\": \"${CHAT_ID}\", \"text\": \"<MESSAGE>\", \"parse_mode\": \"HTML\"}"
done

Static analysis

No suspicious patterns detected.