Back to skill

Security audit

telegram send files

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Telegram file/message sender, but users should treat the bot token and any sent files as sensitive because they are stored or transmitted outside the local machine.

Install only if you are comfortable giving this CLI a Telegram bot token and letting it upload the exact files or messages you ask it to send. Prefer environment variables for TSEND_TOKEN and TSEND_CHAT_ID, restrict ~/.tsend/config.json to your user if you use the config file, and avoid sending sensitive documents unless the Telegram chat is the intended destination.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/tsend/config.py:25
Finding

Telegram bot token stored in plaintext without enforced restrictive permissions

Content
View full analysis
None: """Save configuration to file""" self.CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True) with open(self.CONFIG_PATH, "w", encoding="utf-8") as f: json.dump(self._data, f, indent=2, ensure_ascii=False) ``` The CLI accepts and persists the token as follows: ```python @config_app.command() def set( token: Optional[str] = typer.Option(None, "--token", "-t", help="Set bot token"), chat_id: Optional[str] = typer.Option(None, "--chat-id", help="Set chat ID"), profile: Optional[str] = typer.Option(None, "--profile", "-p", help="Profile to update"), ): """Set configuration values""" cfg = get_config(profile) if profile: typer.echo(f"🔧 Profile: {profile}") elif cfg.active_profile_name: typer.echo(f"🔧 Profile: {cfg.active_profile_name}") else: typer.echo("🔧 Profile: (default)") # Set values if token: cfg.set("token", token) typer.echo("✅ Token updated") if chat_id: cfg.set("chat_id", chat_id) typer.echo("✅ Chat ID updated") # Save if any changes if token or chat_id: cfg.save() ``` ### Technical Analysis The configuration data includes the Telegram bot token and is serialized directly into `~/.tsend/config.json` as plaintext. Neither the configuration directory nor the file is created with an explicit restrictive mode. Their effective permissions therefore depend on the process umask and existing filesystem permissions. On a multi-user system with a permissive umask or an insecure pre-existing `~/.tsend` directory, other local users or processes may be able to read the bot token. The implementation also r ...[truncated 1722 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/pyproject.toml:6
Finding

Mutable and unpinned third-party dependencies create a supply-chain exposure

Content
View full analysis
=0.27.0", "typer>=0.12.0", ] [project.scripts] tsend = "tsend.cli:app" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" ``` The documented installation commands resolve these dependencies dynamically: ```bash cd /scripts uv tool install -e . ``` ```bash cd /scripts pip install -e . ``` ### Technical Analysis The runtime dependencies use open-ended lower bounds, and the build backend is also unpinned. No lockfile or integrity hashes are included. Consequently, installation may retrieve dependency or transitive-dependency versions that were not present when this project was audited. Editable installation still requires the package manager to resolve and install build and runtime requirements. If an upstream dependency, transitive dependency, package index, or publisher account is compromised, a malicious release could be selected during installation. Dependency and build-system code executes with the privileges of the user performing the installation. The identified package names are not demonstrated to be malicious. The risk arises from mutable dependency resolution and the absence of reproducible integrity controls. ### Attack Path 1. An attacker compromises an upstream dependency release, a transitive dependency, a publisher account, or the package index used by the installer. 2. The attacker publishes a malicious version satisfying `httpx>=0.27.0`, `typer>=0.12.0`, an unconstrained transitive requirement, or the unpinned `hatchling` build requirement. 3. A user follows the documented `uv tool install -e .` or `pip install -e .` procedure. 4. The package manager resolves the currently available malicious artifact because ...[truncated 792 chars]
Remediation
View remediation
"] build-backend = "hatchling.build" ``` 6. Perform dependency vulnerability and provenance checks in continuous integration. 7. Use a trusted package index and consider an internal mirror containing only reviewed artifacts. 8. Document a reproducible installation procedure based on the committed lockfile instead of unconstrained online resolution. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (9)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs users to store a Telegram bot token and chat ID in a local config file under the user's home directory without any warning that the token is a secret or guidance on securing the file. Bot tokens grant control over the bot and can enable unauthorized message sending or data access if exposed through backups, logs, shared machines, or weak filesystem permissions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code sends user-specified local files to Telegram via network calls, which can affect user privacy by transmitting file contents to an external service. Although there is a preview of filenames and sizes, there is no explicit warning or confirmation that the files' contents will be uploaded to Telegram.

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 · scripts/tsend/client.py (reported line 14)May include surrounding context.

python
def __init__(self, token: str, chat_id: str):
        self.token = token
        self.chat_id = chat_id
        self.base_url = f"https://api.telegram.org/bot{token}"
        self._client: httpx.AsyncClient | None = None

    async def _get_client(self) -> httpx.AsyncClient:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The method reads an arbitrary local file and transmits its contents to Telegram with no built-in consent, policy check, destination validation, or auditing. In an agent skill context, this creates a clear exfiltration primitive: if upstream logic can influence file_path, sensitive local data may be sent off-host to an external chat without meaningful user awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This method sends arbitrary message text to Telegram without any disclosure or trust boundary enforcement. In an agent environment, that text could contain sensitive prompts, credentials, tokens, or private task data gathered elsewhere, making this an exfiltration channel even though it is framed as normal messaging functionality.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The photo upload path reads local image data and sends it to Telegram without validating sensitivity or requiring confirmation. In a skill setting, screenshots, scanned documents, or other local images may contain confidential information, so this acts as another straightforward exfiltration mechanism.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The save() method persists the entire configuration object, which may include sensitive fields such as authentication tokens and chat identifiers, into a predictable file under the user's home directory. Storing secrets in plaintext on disk increases exposure to local compromise, backups, accidental sharing, or overly permissive filesystem access, especially since no file permission hardening or user warning is present.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: httpx has 2 known advisory(ies) (CVE-2021-41945 (Improper Input Validation in httpx); CVE-2021-41945 (Encode OSS httpx <=1.0.0.beta0 is affected by improper input validation in `http)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The command sends arbitrary message content over the network to Telegram. While the command previews the message and shows a sending status, it does not explicitly warn users that the content is being transmitted to a third-party service.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.