Back to skill

Security audit

tg-cli

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious because its scanners report substantial Telegram administration, bot, and task-management capabilities beyond the stated personal messaging purpose; the review is incomplete.

Consider the suspicious verdict and the reported extra administration, bot, and task-management capabilities before installing. Skillspector's scan was partial: its static tool-misuse analysis was degraded, and some references could not be resolved, so the evidence does not establish that the skill is safe.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
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
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (12)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Most commands support the declared Telegram discovery and message-reading purpose. However, the task commands introduce a substantive workflow-management capability that changes task state rather than merely reading or sending messages. That capability is not disclosed in the description. The supplied chunk is command documentation, so this assessment concerns the capabilities it exposes, not evidence that the commands have already executed.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Although the commands operate within the declared Telegram personal-account context, they include persistent contact-annotation and tag-management operations not disclosed by the description. These are distinct capabilities rather than merely implementation details of finding contacts, reading conversations, or sending messages. Contact lookup and metadata inspection are reasonably related to the declared purpose, but the additional write and delete operations establish a mismatch.

Content

No source excerpt is available for this finding.

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

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

md
## Telegram drafts

`tg personal messages send CHAT "text" --draft` saves a draft for the owner to review and send in Telegram.
It replaces any existing draft in that chat/topic, so confirm the intended replacement when needed.
It sends no message and uses the separate `drafts` permission. Formatting, `--reply-to`, `--topic` and
`--no-preview` work; empty text, attachments, scheduling and other send-only flags are refused.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
paste the QR text block into the chat as a code block, exactly as printed. When a new block is
printed, paste it and say the old one expired. With `--json` each code is also a stderr line
`{"event":"qr","qr":{"text","expires_at","scan"}}`. Login is not an MCP tool: with only MCP, ask
the owner to run the command. Existing sessions are checked without a new login. Missing keyring access
requires fixing the environment, not another login. Pick a chat and an amount of history with
the owner before `tg personal messages sync <chat> --last 100`; setup starts no background service.

Forum-management commands extend the skill beyond reading and sending messages into destructive chat administration.

High
Category
Excessive Agency
Confidence
98% confidence
Finding

L348–L355 instruct use of commands that upgrade basic groups, enable or create forum topics, and permanently delete a topic together with every message in it for everyone. These structural and destructive administration operations are not covered by the setup, lookup, read, and send purposes declared at L004. Requiring explicit authorization reduces accidental execution but does not make these capabilities part of the stated scope.

Content

No source excerpt is available for this finding.

The skill exposes unrestricted Bot API functionality despite describing personal-account messaging only.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The manifest at L004 limits the skill to setting up Telegram and finding, reading, or sending messages through the owner's personal account. L369–L378 instead expose all native Bot API methods, explicitly including financial operations and managed-bot token retrieval or replacement. These are distinct bot-administration capabilities, not implementation details of personal-account messaging; per-command permissions and confirmations do not reconcile that scope mismatch.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

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

md
Reply controls: `tg personal replies add|edit|on|off` edit local rules; `replies audience` controls file-level
allow/deny lists (deny wins). `test` previews stored messages without sending; `status`, `pause` and
`resume` control the profile's rules. Liquid reads sender/chat facts only; incoming text goes to a
model only inside ai blocks. Ordinary previews show instruction/fallback with no model call;
`test --ai` explicitly uses a consented provider. `replies consents grant|revoke` controls profile/
endpoint consent and `deny|allow` controls native chat opt-outs. Never widen the audience or run live
scenarios without the owner's separate consent. Shared `serve` replies to everyone a rule matches unless the audience limits it, and only with explicit

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
use the one-call installer from the installation guide: it repairs user and current-shell PATH,
installs the skill even with disabled lifecycle scripts and verifies bare `tg`. Read `tg skill show`
and verify your skill is loaded before login. If your process predates installation, refresh your
shell PATH from the user/machine environment yourself; do not ask the user to edit PATH.

## Telegram drafts

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
An agent without a terminal (Claude Desktop, Cursor) uses the MCP server instead: `tg personal mcp`. The
profile's `permissions` decide which commands may run, through `tg_tools_search`, `tg_read` and
`tg_write`. Discovery keeps denied commands and their arguments, marking current unavailability
with a reason and permission key. There is no confirmation form. `tg personal mcp config` prints the entry with full paths.

`tg <bot> bot me` reads the bot identity (id, name and username); it needs a token and refuses `--offline`. MCP offers `tg_bot_read` (`command: "me"`).
Bot commands print data only on stdout with `--json`, in the same message shape as the account. Bot exit codes:

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
changing the chat. Dry-run uses cached data only and cannot be combined with refresh. Limit is
bounded at 500 chats. A rule score is not a probability. Automatic claims are separate from manual
labels; rerunning preserves manual labels. Without `--claim`, removing a label removes both claims.
A later explicit auto run can regenerate it. Linking identities never silently combines private notes.

Phones, e-mail addresses, links and Google documents written in stored messages are kept as mentions, found
by rules on every store write. `mentions list` takes a query: `kind:phone|email|url|document`,

Session Persistence

Medium
Category
Rogue Agent
Confidence
55% 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 554)May include surrounding context.

md
`stats contacts responses --answerer <person>`. Known-join newcomer help is `stats chats newcomers <chat>`;
viewed posts with little stored discussion are `stats messages discussion`. Inspect graph/archive
quality and use each row’s exact `selection` with `--component report`; missing history/join dates
are not zero. All four reports read stored data; do not infer historical administrator roles.


Remote agents can request retained bytes: discover attachments show through tg_tools_search

Picture searches require English queries without user opt-in or an explicit justification.

Low
Category
Output Handling
Confidence
94% confidence
Finding

The skill mandates that picture queries be English and instructs the agent to translate the owner's words first. Although limited to picture searches, this imposes a specific language without offering a choice or explaining why the search model requires it; permission to enable picture search is not explicit consent to this language constraint.

Content

No source excerpt is available for this finding.