Back to skill

Security audit

Screenshot Telegram Direct

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it advertises, but it handles secrets and temporary screenshot files in unsafe ways that should be reviewed before installation.

Review this skill before installing. Use it only if you are comfortable sending target URLs and screenshots through the Snap API and Telegram. Avoid adding the documented shell-profile loader, keep any .env file trusted and permission-restricted, and prefer a safer version that parses only the expected keys and uses mktemp with cleanup on all exits.

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
screenshot-send.sh:11
Finding

Arbitrary Shell Execution Through Sourced Credential File

Content
View full analysis
Remediation
View remediation
&2 exit 1 ;; esac done < "$SCRIPT_DIR/.env" ``` A production implementation should also define and enforce an unambiguous escaping format rather than attempting to support arbitrary shell quoting. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
screenshot-send.sh:39
Finding

Predictable Temporary File Allows Symlink-Based File Overwrite

Content
View full analysis
Remediation
View remediation
&2 exit 1 } trap 'rm -f -- "$OUTPUT_FILE"' EXIT ``` Additional hardening should include: - Never construct shared temporary filenames from timestamps, process IDs, URLs, or usernames. - Check that `mktemp` succeeded before invoking `curl`. - Use a private runtime directory where the execution environment provides one. - Keep the cleanup trap active for success, failure, interruption, and signal-handling paths. - Avoid reusing the same temporary file across concurrent executions. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
screenshot-send.sh:50
Finding

Sensitive Screenshot Files Remain After Failed or Interrupted Execution

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (47)

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

Using export $(grep ... | xargs) to ingest a .env file in a shell profile is unsafe because it performs fragile shell parsing and can mis-handle special characters, whitespace, or unexpected content in secret values. It also broadens exposure by exporting the secrets into every shell session, increasing accidental leakage to subprocesses, logs, or unrelated tools.

Content

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

bash
# Auto-load screenshot-telegram-direct env vars
SKILL_DIR="$HOME/.openclaw/workspace/skills/screenshot-telegram-direct"
if [ -f "$SKILL_DIR/.env" ]; then
    export $(grep -v '^#' "$SKILL_DIR/.env" | xargs)
fi

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

This line continues the unsafe pattern of broadly exporting .env contents into the environment from a shell profile. Besides parsing problems, it unnecessarily propagates Telegram and API credentials to unrelated child processes, increasing the chance of inadvertent disclosure.

Content

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

Auto-load screenshot-telegram-direct env vars

SKILL_DIR="$HOME/.openclaw/workspace/skills/screenshot-telegram-direct" if [ -f "$SKILL_DIR/.env" ]; then export $(grep -v '^#' "$SKILL_DIR/.env" | xargs) fi

text

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

Directly sourcing a .env file as shell code can execute arbitrary commands if that file is modified, malformed, or attacker-controlled. In a shared workspace or compromised environment, this turns a secrets file into a code execution vector.

Content

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

bash
#!/bin/bash
source "$HOME/.openclaw/workspace/skills/screenshot-telegram-direct/.env"
echo "✅ Environment loaded from screenshot-telegram-direct/.env"

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

The recommendation to auto-source .env in the script repeats the same code-execution risk: a .env file is treated as executable shell input. If an attacker can modify that file, the script will run arbitrary commands before performing its intended action.

Content

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

The script already checks for env vars. To auto-source .env if it exists, add at the top:

bash
# Auto-source .env if it exists in script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "$SCRIPT_DIR/.env" ]; then
    source "$SCRIPT_DIR/.env"

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

This line is part of the conditional that sources the .env file, so it participates in the same unsafe behavior. The danger is not secret storage itself but executing attacker-modifiable configuration as shell code.

Content

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

bash
# Auto-source .env if it exists in script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "$SCRIPT_DIR/.env" ]; then
    source "$SCRIPT_DIR/.env"
fi

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

This line closes the block that sources the .env file and is part of the same insecure pattern. In context, the documentation normalizes executing configuration content as shell, which can enable command execution via tampered env files.

Content

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

Auto-source .env if it exists in script directory

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [ -f "$SCRIPT_DIR/.env" ]; then source "$SCRIPT_DIR/.env" fi

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · screenshot-send.sh (reported line 6)May include surrounding context.

sh
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · screenshot-send.sh (reported line 7)May include surrounding context.

sh
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · screenshot-send.sh (reported line 29)May include surrounding context.

sh
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · skill.md (reported line 21)May include surrounding context.

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · skill.md (reported line 22)May include surrounding context.

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · skill.md (reported line 52)May include surrounding context.

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · skill.md (reported line 59)May include surrounding context.

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · skill.md (reported line 182)May include surrounding context.

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · skill.md (reported line 183)May include surrounding context.

md
# Works around OpenClaw issue #63137 by using direct Telegram API
# 
# Setup:
#   1. cp .env.example .env
#   2. Edit .env with your tokens
#   3. Run: ./screenshot-send.sh https://example.com

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

Automatically sourcing a .env file executes shell syntax from that file in the current process, so if the .env file is modified by another local user, pulled from an untrusted source, or accidentally contains shell code, arbitrary commands could run. In an agent/skill setting, implicit execution of local configuration is riskier than simply parsing key-value pairs because it expands the attack surface from secret loading to code execution.

Content

Scanner excerpt · screenshot-send.sh (reported line 12)May include surrounding context.

sh
set -e

# Auto-source .env if it exists in script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "$SCRIPT_DIR/.env" ]; then
    source "$SCRIPT_DIR/.env"

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

The conditional check is part of a flow that leads to sourcing the .env file, enabling execution of untrusted shell content if the file exists. While the existence test alone is harmless, in this context it directly gates unsafe loading of a potentially attacker-controlled file.

Content

Scanner excerpt · screenshot-send.sh (reported line 14)May include surrounding context.

sh
# Auto-source .env if it exists in script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "$SCRIPT_DIR/.env" ]; then
    source "$SCRIPT_DIR/.env"
fi