Back to skill

Security audit

Telegram Send File

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it advertises, but it can upload arbitrary local files to Telegram using auto-discovered bot credentials and chat context without an explicit confirmation step.

Install only if you are comfortable with an agent-accessible command that can send any readable file to Telegram. Prefer explicit --chat-id/--topic-id, verify the file path before use, store the bot token with restrictive permissions or an environment secret manager, avoid passing tokens on the command line, and pin dependencies in your own environment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
README.md:25
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
=20.0 ``` `scripts/telegram_send_file.py:27-29`: ```python except ImportError: print("Error: python-telegram-bot not installed. Run: pip install python-telegram-bot>=20.0") sys.exit(1) ``` ### Technical Analysis The project instructs users to install any release of `python-telegram-bot` satisfying `>=20.0`. It does not provide an exact version, lock file, or package integrity hashes. Consequently, the code installed by a user can differ from the dependency version that was originally reviewed. The dependency executes in the same Python process as the skill and therefore has access to the bot token, destination chat information, local files selected for upload, environment variables, and the invoking user's filesystem permissions. If a future eligible release or its distribution channel is compromised, malicious package code could execute during installation or import. This finding does not establish that the current `python-telegram-bot` package is malicious. The vulnerability is the absence of reproducible dependency pinning and integrity verification. ### Attack Path 1. An attacker compromises a future release, maintainer account, or distribution artifact for the dependency. 2. The compromised release still satisfies the documented `>=20.0` version constraint. 3. A user follows the installation instruction or updates the package at a later date. 4. The package manager downloads and installs the compromised release. 5. Malicious installation or import-time code executes with the privileges of the invoking user. 6. The malicious code can access Telegram credentials, selected files, and other data available to the process. ### Impact Assessment S ...[truncated 484 chars]
Remediation
View remediation
``` 2. Add a committed lock or requirements file containing cryptographic hashes. 3. Install with hash verification, such as: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Regularly review and deliberately update the pinned version after security testing. 5. Document installation from an approved package index and discourage untrusted mirrors. 6. Avoid installing dependencies with administrator or root privileges. 7. Update both the README and the import-error message so they reference the secured, reproducible installation process. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/telegram_send_file.py:240
Finding

Telegram Bot Token Exposed Through Command-Line Arguments

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
README.md:46
Finding

Recommended Token File Creation Does Not Enforce Restrictive Permissions

Content
View full analysis
~/.telegram_bot_token ``` ### Technical Analysis The recommended command stores the Telegram bot token in plaintext without explicitly setting owner-only permissions. The resulting permissions depend on the user's active `umask`. On a shared system with a permissive `umask`, the token file may be readable by other local accounts. The script subsequently reads this file as a credential source. It does not inspect the file owner or reject group-readable or world-readable permissions before using the token. ### Attack Path 1. A user follows the documented command while operating under a permissive `umask`. 2. `~/.telegram_bot_token` is created with permissions that allow an unintended local account to read it. 3. Another local user or a process running under that account reads the plaintext token. 4. The attacker uses the token to authenticate directly to the Telegram Bot API. 5. The attacker impersonates the bot within its existing Telegram permissions. ### Impact Assessment Successful exploitation exposes the Telegram bot credential to another local principal. The attacker can perform Bot API operations available to that bot, including unauthorized messaging or file delivery to accessible chats. This issue does not directly provide operating-system privilege escalation; its scope is primarily the bot account and its Telegram permissions. ]]>
Remediation
View remediation
~/.telegram_bot_token chmod 600 ~/.telegram_bot_token ``` 2. Recommend an operating-system credential store instead of a plaintext file where available. 3. In the script, inspect the token file's owner and permission bits before reading it. 4. Reject or prominently warn about token files that are group-readable, world-readable, or owned by another user. 5. Apply the same permission checks to all supported plaintext token locations. 6. Document token rotation through BotFather if a token file was previously exposed. ]]>
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 (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README promotes sending local files to Telegram and auto-detecting Telegram/OpenClaw chat context, but it does not warn users that this can transmit sensitive local data to an external service or to an unintended chat/thread. In a skill meant for agent use, auto-detection lowers friction for exfiltration or accidental disclosure because the operator may not explicitly verify the destination before sending.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · README.md (reported line 63)May include surrounding context.

Send any message to your bot in Telegram, then visit:

text
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates

Look for "id": 5866004662 in the JSON response — that's your personal chat ID.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documents execution of a local Python script that can read local files and likely access environment-derived Telegram/session context, but it does not declare any explicit tool scope such as permissions or allowed-tools. That mismatch weakens security review and policy enforcement, because consumers of the skill may not realize it needs file-read and environment access before using it to transmit data to an external Telegram chat.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script silently sources a Telegram bot token from environment variables and multiple local files, including OpenClaw state/config, without requiring explicit user acknowledgement at send time. In an agent skill context, this lowers the barrier to unauthorized message/file transmission if the skill is invoked unexpectedly or by a compromised workflow, because credentials are auto-discovered and immediately usable.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill can transmit arbitrary local files, URLs, or Telegram file_ids to an external Telegram chat with no confirmation prompt, while also auto-detecting chat/thread context from environment or OpenClaw session state. In an agent environment, that creates a clear exfiltration primitive: if the tool is called on sensitive paths or attacker-influenced inputs, data can leave the host immediately to a remote destination.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains multiple examples for sending documents, photos, videos, audio, and voice messages to Telegram, which inherently transmit user-provided file data over the network. The reference does not include any warning about privacy, external transmission, or verifying that the files are safe and intended to be shared.

Content

No source excerpt is available for this finding.