Back to skill

Security audit

Telegram Post

Security checks for vulnerabilities and agentic risk

Overview

This Telegram posting skill has a coherent purpose, but it exposes a reusable privileged bot token and direct API commands that could let others post as the bot.

Do not install this version until the Telegram token is revoked and removed. A safer version should use the OpenClaw Telegram channel or environment-managed secrets, require confirmation before sending, and avoid documenting reusable credentials or direct API calls unless tightly scoped.

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:58
Finding

Hard-Coded Privileged Telegram Bot Token

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:58-62 and SKILL.md:90-92
Vulnerability Type: Hard-coded authentication credential
Risk Level: High

Vulnerable Code

SKILL.md:58-62:

bash
curl -X POST "https://api.telegram.org/bot8415787322:AAGK4aQCCGei35g9t2ybKhexlR4BdCZs-3M/sendMediaGroup" \
  -F "chat_id=-1003856211981" \
  -F 'media=[{"type":"photo","media":"attach://f1","caption":"Текст"},{"type":"photo","media":"attach://f2"}]' \
  -F "f1=@/home/larthe/.openclaw/media/inbound/file1.jpg" \
  -F "f2=@/home/larthe/.openclaw/media/inbound/file2.jpg"

SKILL.md:90-92:

bash
# Проверить gateway
curl -s http://127.0.0.1:18789/health

# Проверить бота
curl -s "https://api.telegram.org/bot8415787322:AAGK4aQCCGei35g9t2ybKhexlR4BdCZs-3M/getMe"

Relevant privilege context is documented at SKILL.md:84-86:

text
✅ Бот имеет **Privacy Mode: Disabled** — видит все сообщения в группах
✅ **groupPolicy: "open"** — может отправлять без упоминания
✅ Бот — админ в группе `-1003856211981`

Technical Analysis

A complete Telegram Bot API authentication token is embedded directly in the Skill documentation. Possession of this token is sufficient to authenticate Bot API requests as the associated bot; no additional password or local OpenClaw access is required.

The credential is exposed in both a media-upload example and a bot-status command. Consequently, anyone who can read the Skill package, a copy of the repository, generated documentation, backups, or retained repository history can extract and reuse it independently of the intended OpenClaw workflow.

The documented configuration increases the severity: the bot is described as an administrator of the primary group, as having Privacy Mode disabled, and as operating under an open group policy. The exact effect of compromise depends on the bot's granted Telegram administrator rights and update-delivery configuration, but ...[truncated 1706 chars]

Remediation
View remediation

Remediation Suggestions

  1. Immediately revoke the exposed token through Telegram BotFather and generate a replacement. Merely removing it from the current file is insufficient because existing copies may remain available.

  2. Remove the token from SKILL.md, repository history, release artifacts, documentation, logs, and backups where feasible.

  3. Store the replacement in a dedicated secret manager or a protected environment variable such as TELEGRAM_BOT_TOKEN.

  4. If direct API access remains necessary, construct the endpoint at runtime without recording the token in source-controlled text:

    bash
    test -n "$TELEGRAM_BOT_TOKEN" || {
      echo "TELEGRAM_BOT_TOKEN is not configured" >&2
      exit 1
    }
    
    curl --fail --show-error --silent \
      -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMediaGroup" \
      -F "chat_id=${TELEGRAM_CHAT_ID}" \
      -F 'media=[{"type":"photo","media":"attach://f1","caption":"Text"},{"type":"photo","media":"attach://f2"}]' \
      -F "f1=@${MEDIA_FILE_1}" \
      -F "f2=@${MEDIA_FILE_2}"
    
  5. Prefer the already configured OpenClaw Telegram channel over exposing raw Bot API authentication in Skill instructions.

  6. Restrict access to any secret-bearing configuration file using least-privilege filesystem permissions and ensure it is excluded from version control.

  7. Review and minimize the bot's Telegram administrator permissions. Remove administrator status if ordinary posting rights are sufficient.

  8. Enable Privacy Mode where operationally feasible and replace the open group policy with an explicit allowlist of approved chats or users.

  9. Review Telegram configuration and available logs for unexpected messages, webhook changes, or other activity performed with the exposed credential.

  10. Add automated secret scanning to commits and release pipelines to prevent future publication of Telegram tokens and similar credentials.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill lacks an explicit warning that it will transmit message content and local media files to external Telegram groups. Without a clear disclosure and confirmation step, users may unknowingly authorize external sharing of potentially sensitive data, especially since the skill references a local inbound media directory and group posting workflows.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill claims posting occurs via OpenClaw CLI but later switches to raw Telegram API calls, creating capability drift and bypassing any controls, logging, or policy enforcement the CLI may provide. This inconsistency makes the skill more dangerous because operators may believe they are using a constrained interface while actually being guided to use broader direct network access with embedded credentials.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases are broad everyday requests such as 'send a post' or 'write to the robotics group,' which increases the chance of accidental invocation and unintended posting to real external groups. In a messaging skill tied to fixed group IDs, ambiguous triggers can cause unauthorized or mistaken disclosure of text and media.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill embeds a live Telegram bot token in documentation and instructs direct use of the Telegram Bot API, which exceeds the stated OpenClaw-only scope. Exposed bot credentials allow anyone with access to the skill to send messages, inspect bot metadata, and potentially abuse the bot's privileges in groups where it is an admin.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
99% confidence
Finding

This instruction sends data to an external Telegram API endpoint using an embedded bot token and attached local files. Because the bot token is exposed and the action transmits content outside the local environment, misuse could lead to unauthorized posting, data exfiltration of media files, and abuse of the bot's admin access in the target group.

Content

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

4. Альбом (через API, до 10 фото)

bash
curl -X POST "https://api.telegram.org/bot8415787322:AAGK4aQCCGei35g9t2ybKhexlR4BdCZs-3M/sendMediaGroup" \
  -F "chat_id=-1003856211981" \
  -F 'media=[{"type":"photo","media":"attach://f1","caption":"Текст"},{"type":"photo","media":"attach://f2"}]' \
  -F "f1=@/home/larthe/.openclaw/media/inbound/file1.jpg" \

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

Список файлов:

bash
ls -la /home/larthe/.openclaw/media/inbound/*.jpg

Важно

External Transmission

Medium
Category
Data Exfiltration
Confidence
98% confidence
Finding

The health-check example for getMe still exposes the bot token to an external Telegram endpoint, disclosing reusable credentials in plain text. Even though the call is read-oriented, anyone seeing the skill can reuse the token for higher-impact API actions supported by the bot.

Content

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

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The entire skill instruction set is written in Russian and presents usage only in that language, with no indication that users may choose another language or locale. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.