Back to skill

Security audit

Telegram File Sender

Security checks for vulnerabilities and agentic risk

Overview

This skill openly sends local files to Telegram, but its scope is too broad and its cleanup/output handling create avoidable risks.

Review before installing. Only use this with non-sensitive files you intentionally want to upload to Telegram, and confirm the exact file path, recipient chat ID, and bot account before sending. Avoid using it on secrets, credentials, private documents, browser/app data, archives, or broad home-directory paths until the skill adds stricter path controls, safer structured output, and validated cleanup.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send_file.py:80
Finding

Control-Field Injection Through Unencoded Line-Oriented Output

Content
View full analysis
3 else "" account_id = sys.argv[4] if len(sys.argv) > 4 else "CyreneAssistant_bot" ``` ```python filename = os.path.basename(src_path) ``` ```python print(f"SEND_PATH={send_path}") print(f"SEND_FILENAME={send_filename}") print(f"TARGET={target}") print(f"CAPTION={caption}") print(f"ACCOUNT_ID={account_id}") print("READY") ``` The corresponding parsing instruction is: ```markdown Extract `SEND_PATH`, `TARGET`, `ACCOUNT_ID` from the output. ``` ### Technical Analysis The script creates a line-oriented control protocol by directly interpolating caller-controlled values into `KEY=VALUE` records. The target, caption, account ID, and source filename are not validated or encoded before being printed. On filesystems and command-line interfaces that permit newline characters in these values, an attacker can inject additional protocol records such as `TARGET=...`, `ACCOUNT_ID=...`, `SEND_PATH=...`, or `READY`. The Skill documentation does not define a strict grammar, reject duplicate keys, or specify whether the first or last occurrence of a key takes precedence. Consequently, exploitation depends on the consuming Agent's parsing behavior, but the protocol itself does not preserve a trustworthy boundary between data and control fields. ### Attack Path 1. An attacker creates or selects a file whose basename contains newline characters followed by forged control records, or supplies newline-bearing target, caption, or account ID arguments. 2. The attacker asks the Agent to send that file through this Skill. 3. The script places the untrusted basename in `SEND_PATH` and `SEND_FILENAME`, or directly emits another untrusted argument. 4. The embedd ...[truncated 938 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:91
Finding

Command Injection Risk in Documented Shell Cleanup Procedure

Content
View full analysis
rm -rf ``` ``` ### Technical Analysis `SEND_PATH` includes the basename of the caller-selected source file. A filename can contain spaces, shell metacharacters, command substitutions, glob characters, or option-like text. The documented cleanup procedure instructs the Agent to substitute that path into shell commands without quoting it or using an end-of-options marker. If the Agent constructs and runs the command as written, the shell can interpret portions of the path as syntax rather than as a single path argument. Even absent metacharacter-based command execution, whitespace, wildcard expansion, or a leading option can cause deletion of files other than the intended temporary artifact. The `parent_tmp_dir` value is also not emitted as a separate validated field. Deriving it through textual shell manipulation can introduce additional path-confusion risk. ### Attack Path 1. An attacker creates or identifies a source file with a basename containing shell-significant characters. 2. The attacker requests that the Agent send the file. 3. `send_file.py` copies the file into a temporary directory while preserving its basename and emits the resulting `SEND_PATH`. 4. The Agent sends the file successfully. 5. Following `SKILL.md`, the Agent interpolates the emitted path into `rm ` or derives and interpolates its parent directory into `rm -rf `. 6. The shell interprets attacker-controlled characters as command syntax, separate arguments, options, or wildcard expressions. 7. Commands may run with the Agent process's operating-system privileges, or unintended files may be deleted. ### Impact Assessment If the cleanup comm ...[truncated 506 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/send_file.py:67
Finding

Sensitive Temporary Files Persist on Failure or Interrupted Workflows

Content
View full analysis
MAX_SIZE: zip_path = os.path.join(tmp_dir, filename + ".zip") zipped = try_zip(src_path, zip_path) if zipped and get_file_size(zipped) <= MAX_SIZE: send_path = zipped send_filename = filename + ".zip" print(f"INFO: Compressed {size/1024/1024:.1f}MB -> {get_file_size(zipped)/1024/1024:.1f}MB") else: print(f"FAIL: File too large ({size/1024/1024:.1f}MB) — compression did not reduce below 50MB") print("SUGGESTION: Split the file into smaller parts, or send a summary + external link") sys.exit(1) else: tmp_path = os.path.join(tmp_dir, filename) shutil.copy2(src_path, tmp_path) send_path = tmp_path send_filename = filename print(f"SEND_PATH={send_path}") print(f"SEND_FILENAME={send_filename}") print(f"TARGET={target}") print(f"CAPTION={caption}") print(f"ACCOUNT_ID={account_id}") print("READY") except Exception as e: print(f"FAIL: {e}") sys.exit(1) ``` ### Technical Analysis The script creates a temporary directory before copying or compressing the source file, but it has no `finally` block or other deterministic cleanup mechanism. If compression fails, if the compressed file remains over 50 MB, or if another exception occurs, the script exits without deleting the directory or partial archive. On the success path, cleanup is delegated to the Agent after a separate message-tool call. If sending fails, the process is interrupted, or the Agent does not execute the cleanup instructions, the copied file remains in the temporary directory. `tempfile.mkdtemp()` normally creates a restrictively permissioned directory, which reduces e ...[truncated 1403 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This skill is explicitly designed to transfer arbitrary local files from the agent's filesystem to a Telegram recipient on request, crossing a trust boundary and enabling data exfiltration. The danger is amplified by support for local absolute paths, iCloud paths, and broad use cases, which can expose sensitive documents unrelated to the current task.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow tells the agent to ask for a path, resolve it, and send that file to Telegram, which creates a direct natural-language path from user prompt to arbitrary file exfiltration. Without strong authorization, path restrictions, or sensitivity checks, a user can induce the agent to retrieve and transmit confidential local files.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

By stating that any file type can be sent, including binary files and local documents, the skill broadens exfiltration capability to essentially all locally accessible data. In context, this is especially dangerous because it removes natural constraints and encourages use for arbitrary content, increasing the blast radius of prompt-induced or mistaken transfers.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad enough to activate on common conversational requests like 'send me' or '发给我', which can cause the skill to engage in high-risk file transfer behavior without sufficiently explicit user intent. Because the skill's purpose is external transmission of local files, ambiguous activation materially increases the chance of accidental data exfiltration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill describes sending local files to Telegram but does not prominently warn that this is a third-party external transfer, which may expose sensitive local data to an external service and recipient. Users and agents need clear notice because the core action is exfiltration from the local environment to an outside messaging platform.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The usage guidance authorizes the skill for loosely defined situations like a user asking to 'send me the file' without defining what file sources are allowed or what confirmation is required. In a skill that moves data from the local filesystem to Telegram, ambiguous boundaries increase the risk that the agent selects and transmits sensitive files based on underspecified natural-language requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script prints the temporary send path, recipient target, caption, and account identifier to stdout in a machine-readable form. In agent-based systems, stdout is commonly captured by logs, orchestration layers, or other tools, which can expose sensitive filesystem locations and recipient metadata to unintended parties without any minimization or confirmation step.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The cleanup step instructs deletion of the temporary file and parent temporary directory without warning about destructive side effects or validating that the path is a dedicated temp location. While lower severity than the exfiltration issues, this can still cause unintended deletion if path handling is incorrect or misunderstood.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.