Back to skill

Security audit

MAC OS screenshot to telegram

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended to send macOS screenshots to Telegram, but its broad trigger and credential handling create a real risk of accidental sensitive sharing.

Review before installing. Use it only if you intentionally want the current full screen uploaded to a Telegram chat through a bot. Prefer a version that triggers only on explicit send-to-Telegram requests, asks for confirmation with the destination chat ID, enforces an allowlist, previews or limits the capture area, and avoids putting the bot token in command-line arguments.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/screenshot-telegram.sh:35
Finding
Telegram Bot Token Exposed in Process Command-Line Arguments## Vulnerability Details **File Location**: `scripts/screenshot-telegram.sh:35-37` **Additional Location**: `SKILL.md:59` **Vulnerability Type**: Credential exposure through process arguments **Risk Level**: Medium **Vulnerable Code**: ```bash RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendPhoto" \ -F "chat_id=${CHAT_ID}" \ -F "photo=@${WORKSPACE}/screen.png") ``` ### Technical Analysis The script interpolates the Telegram bot token directly into the URL passed to `curl`. Consequently, the complete API URL, including the secret token, becomes part of the `curl` process command-line arguments while the request is running. Depending on local operating-system permissions and monitoring configuration, command-line arguments can be visible through process inspection utilities, endpoint monitoring agents, diagnostic tooling, shell tracing, or process accounting. A local user or process with sufficient process-observation privileges could capture and reuse the token. The same unsafe invocation is recommended in `SKILL.md`, meaning the documentation propagates the vulnerable pattern even if the bundled script is not used directly. ### Attack Path 1. An attacker obtains local process-observation capability on the host, such as access to process-listing or monitoring facilities permitted by the operating system. 2. The user invokes the Skill to capture and send a screenshot. 3. While `curl` is executing, the attacker inspects its command-line arguments. 4. The attacker extracts the bot token from the URL path following `https://api.telegram.org/bot`. 5. The attacker submits Telegram Bot API requests using the stolen token. 6. The attacker can impersonate the bot and perform operations permitted to that bot in chats where it has access. Exploitation requires local process visibility or equivalent telemetry access; this finding does not provide remote token disclosure by itself. ### ...[truncated 624 chars]
Remediation
## Remediation Suggestions - Do not place the Telegram bot token in command-line arguments. Supply the sensitive URL to `curl` through a protected standard-input configuration instead: ```bash RESPONSE=$( printf 'url = "https://api.telegram.org/bot%s/sendPhoto"\n' "$BOT_TOKEN" | curl --silent --config - \ -F "chat_id=${CHAT_ID}" \ -F "photo=@${WORKSPACE}/screen.png" ) ``` - Ensure shell tracing is disabled around all credential-handling code. If tracing may be enabled by the caller, use `set +x` before reading or using the token. - Avoid logging the complete request URL or bot token in application, proxy, endpoint-monitoring, and diagnostic logs. - Restrict the OpenClaw configuration file containing `botToken` to the owning account, preferably with mode `0600`. - Replace the vulnerable example in `SKILL.md` so users do not reproduce the command-line exposure. - Rotate the Telegram bot token through BotFather if process telemetry or logs may already have captured it.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared purpose only mentions taking a screenshot and sending it to Telegram, but the implementation also reads a bot token from local config, stages the image in a workspace, and depends on profile/chat ID inputs. That mismatch hides sensitive credential access and external transmission behavior, increasing the chance of uninformed use and unintended data disclosure.

Missing User Warnings

High
Confidence
98% confidence
Finding
The skill lacks an explicit warning that screenshots are transmitted to Telegram using a bot API, which is a third-party external service. Screenshots often contain highly sensitive data, so omitting a clear disclosure materially increases the risk of users authorizing exfiltration without informed consent.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill uses shell commands to capture screenshots, read local configuration, copy files, and invoke curl, but it declares no tool scope or permissions. This creates an unsafe trust boundary because a caller cannot tell from metadata that the skill needs powerful local execution and network exfiltration capabilities.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The trigger condition is broad enough to match ordinary requests to 'capture the screen' or 'take a screenshot' without clearly signaling that the result will be sent off-device to Telegram. In context, this makes accidental exfiltration more likely because a common benign screenshot request can invoke network transmission behavior.

External Transmission

Medium
Category
Data Exfiltration
Content
3. **Send via Telegram Bot API** (bypasses buggy message tool):
   ```bash
   BOT_TOKEN=$(grep botToken <config-path> | sed 's/.*"botToken": *"\([^"]*\)".*/\1/')
   curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendPhoto" \
     -F "chat_id=<target-chat-id>" \
     -F "photo=@<workspace>/screenshot.png"
   ```
Confidence
95% confidence
Finding
The skill sends a locally captured screenshot to https://api.telegram.org using a bot token, which is an external transmission of potentially sensitive screen contents. In this skill context the transmission is intentional, but it remains security-relevant because screenshots can expose credentials, personal data, or confidential work product.

External Transmission

Medium
Category
Data Exfiltration
Content
# Send via Telegram Bot API
echo "Sending to Telegram chat $CHAT_ID..."
RESPONSE=$(curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendPhoto" \
    -F "chat_id=${CHAT_ID}" \
    -F "photo=@${WORKSPACE}/screen.png")
Confidence
98% confidence
Finding
The script captures a full macOS screenshot and uploads it to Telegram, an external third-party service, using a bot token read from local configuration. Because screenshots can contain sensitive data such as credentials, personal information, internal documents, or other secrets, this creates a real data-exfiltration path; the skill context explicitly centers on screen capture and external transmission, which makes the finding more dangerous rather than less.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The setup instructions switch into Cantonese/Chinese for multiple steps, which can impose a language requirement on users who may expect English-only documentation. The file does not offer an alternative language version or explain that the skill is intentionally localized for a specific audience.

Static analysis

No suspicious patterns detected.