Back to skill

Security audit

Tg Cli

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marked this skill suspicious because it reports broad Telegram and related account-management capabilities beyond the stated messaging purpose, with concerns about confirmation for writes and persistent or high-impact actions; the scan was partial.

Consider avoiding installation unless you need these broader capabilities and have reviewed their permissions, especially MCP writes and destructive actions. The scan covered all 10 listed components but was marked partial because two local path-like references could not be resolved, so the evidence is incomplete. The suspicious verdict signals reported security weaknesses or undeclared risky behavior; it does not establish malicious intent.

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

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Most commands support the declared Telegram functionality. However, search all explicitly adds notes and Drive documents, which are not covered by the Telegram-focused description. Restricting that command to occasions when the owner asks does not remove the undeclared resource access. Local archive searches and conversation-link rebuilding are supporting implementation details, not separate mismatches.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Inbox reading and conversation review align with the declared purpose. However, the task commands introduce a distinct state-changing task-management capability beyond reading or sending Telegram messages. Owner-confirmation requirements constrain some operations but do not make this capability declared. The supplied chunk is command documentation, so it demonstrates supported operations rather than proving that any were executed.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

Contact lookup and metadata inspection or synchronization reasonably support the declared search and reading workflows. However, the chunk also includes persistent changes to contact annotations and chat tags. Those management capabilities go beyond the described history lookup, message reading/sending, and setup functions and are not disclosed in the declared purpose.

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 · references/messages.md (reported line 70)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.

L104-L105 expose permanent deletion of a forum topic and all its messages for everyone, beyond the skill's stated read/send purpose.

High
Category
Excessive Agency
Confidence
96% confidence
Finding

The manifest describes answering questions from Telegram history, reading and sending messages, and setting up account access. Permanently deleting an entire forum topic's history for all participants is a destructive administration capability, not a requirement of those tasks; requiring explicit authorization does not bring it within the declared purpose.

Content

No source excerpt is available for this finding.

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 · references/setup.md (reported line 75)May include surrounding context.

md
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 in a terminal or to sign in from WireCat Desktop (Tools → Telegram → Manage).
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.

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 · references/tasks.md (reported line 50)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
87% confidence
Finding

The documented MCP behavior permits writes under an 'ask' permission without obtaining server-side confirmation, while client approval is only recommended rather than required or verified. If the client has no approval gate, an agent error or compromised client can produce real account writes despite a profile configured to ask.

Content

Scanner excerpt · references/mcp-and-bots.md (reported line 22)May include surrounding context.

md
An agent without a terminal (Claude Desktop, Cursor) uses the MCP server instead: `tg personal mcp serve`. 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: approval for a write is the MCP client's, so ask
the owner to turn it on. `tg personal mcp config` prints the entry with full paths.

`tg personal mcp serve --http --public-url https://<name>.ts.net` serves behind your tunnel with its own owner-code login;

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

Mapping both 'ask' and 'allow' to permission to write removes the confirmation guarantee associated with 'ask'. Owner-code login authenticates access to the server but does not establish approval for each subsequent write, leaving unauthorized actions possible when client confirmation is absent.

Content

Scanner excerpt · references/mcp-and-bots.md (reported line 26)May include surrounding context.

md
the owner to turn it on. `tg personal mcp config` prints the entry with full paths.

`tg personal mcp serve --http --public-url https://<name>.ts.net` serves behind your tunnel with its own owner-code login;
MCP has no server forms. `deny`/`readonly` block writes; `ask`/`allow` permit the requested write without asking,
so the client's approval is the only prompt.
Repeat `--permission key=level` to tighten permissions for the server; it never loosens them. Never change permissions to bypass a refusal.
`tg personal mcp revoke` forgets browser logins for the profile.

The skill exposes unrestricted categories of bot administration and financial operations beyond its stated personal-messaging purpose.

Medium
Category
Excessive Agency
Confidence
93% confidence
Finding

The manifest describes searching the owner's Telegram history and reading or sending messages through their personal account. This file additionally exposes all 185 Bot API methods, explicitly including financial operations and managed-bot credential retrieval or replacement; these capabilities are not justified by that purpose. Per-method permissions and approval defaults mitigate execution risk but do not resolve the purpose mismatch.

Content

No source excerpt is available for this finding.

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 · references/people.md (reported line 51)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`,

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 · references/setup.md (reported line 52)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.

## First setup

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 · references/stats.md (reported line 19)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.

Retention: `tg personal stats chats retention <chat> --checkpoints 1d,7d,30d --within 7d --json`.
Only a known join date defines cohorts. Report observable denominators, unknown/pending and actual snapshot time.

Picture-search queries are required to be English without an explicit language choice or documented justification.

Low
Category
Output Handling
Confidence
88% confidence
Finding

The instruction requires English picture queries and directs the agent to translate the owner's words automatically. It does not offer a language choice or explain why the picture-search model requires this language restriction.

Content

No source excerpt is available for this finding.