Back to skill

Security audit

clawaifu - OpenClaw Waifu

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent with its selfie-to-Telegram purpose, but it needs Review because it automatically sends user content through third-party services and has a verified file-disclosure bug in its Telegram upload command.

Install only if you are comfortable with prompts, generated images, captions, and Telegram destination details leaving your machine. Use a dedicated low-privilege Telegram bot and Fal key, verify the chat ID, avoid sensitive captions or context, and fix the curl form handling with literal form values before using it in any environment where local files or credentials matter.

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

T09 · Insecure Skill Coding Practices

Error
Location
grok-selfie.sh:70
Finding

User-Controlled Multipart Values Can Cause Local File Disclosure

Content
View full analysis
/dev/null 2>&1 else curl -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendPhoto" \ -F "chat_id=$TELEGRAM_CHAT_ID" \ -F "photo=$IMAGE_URL" > /dev/null 2>&1 fi ``` ### Technical Analysis The script passes variable-backed scalar values to `curl` using `-F`. In curl multipart syntax, a value beginning with `@` is interpreted as a local filename whose contents should be uploaded. Shell quoting prevents shell expansion but does not disable curl's own `@filename` interpretation. `CAPTION` is taken directly from the third command-line argument without validation. Consequently, a caption such as `@/etc/passwd` can instruct curl to open the specified local file and place its contents in the outbound multipart request. The same parsing behavior affects other variable-backed `-F` fields, although the caption is the field most directly exposed to user-controlled input. The comment and documentation asserting that `curl -F` safely transmits form data are therefore inaccurate for untrusted scalar values. ### Attack Path 1. An attacker supplies or influences a selfie request whose caption begins with `@`, such as `@/etc/passwd`. 2. The agent or caller invokes: ```bash ./grok-selfie.sh "some context" mirror "@/etc/passwd" ``` 3. The script assigns the third argument to `CAPTION`. 4. The value is passed to curl as `-F "caption=$CAPTION"`. 5. Curl interprets the value as a request to read `/etc/passwd`. 6. Curl includes the local file in the HTTPS multipart request sent to Telegram. 7. Even if Telegram rej ...[truncated 711 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
grok-selfie.sh:56
Finding

API Credentials Are Exposed in Process Command-Line Arguments

Content
View full analysis
/dev/null 2>&1 ``` ### Technical Analysis Although the credentials originate from environment variables rather than being hardcoded, they are expanded directly into curl's command-line arguments. The Fal API key is placed in the `Authorization` header argument. The Telegram bot token is embedded in the request URL. While curl is running, these expanded values may be visible through process inspection facilities such as `/proc//cmdline`, `ps`, process accounting, debugging utilities, endpoint monitoring, or audit systems. The practical exploitability depends on the host's process-visibility configuration and the attacker's local access. Systems with restricted `/proc` visibility reduce the exposure, but the script itself does not enforce such restrictions. ### Attack Path 1. An attacker obtains local process-observation capability on the host, such as access through another user account, a monitoring service, process accounting, or a compromised diagnostic utility. 2. The attacker waits for or repeatedly observes invocation of `grok-selfie.sh`. 3. While curl is running, the attacker inspects its command line. 4. The attacker extracts either: - `Authorization: Key ` from the header argument, or - the Telegram bot token from `/bot/sendPhoto`. 5. The captured credential is replayed directly against the corresponding external service. ### Impact Assessment Compromise of `FAL_KEY ...[truncated 653 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
  • 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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill advertises itself as a harmless 'waifu companion' but also discloses capabilities to call an external image-editing API and send generated content to Telegram using sensitive credentials. That mismatch can mislead users and operators about data flow, permissions, and external delivery, increasing the chance of unintended disclosure of prompts, captions, generated images, and bot access.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The script has shell execution capability and performs networked actions, but the metadata reportedly does not declare that permission. In an agent/skill ecosystem, undeclared execution capability is dangerous because reviewers and users may not realize the skill can make outbound requests and handle secrets, reducing transparency and consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description explains image generation and Telegram delivery, but it does not clearly warn users that their context and captions are sent to third-party services and that outputs are delivered to an external recipient/chat. Missing disclosure undermines informed consent and may expose sensitive or private prompt content to external processors and destinations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases include ordinary conversational inputs like 'how are you doing?' and 'where are you?', which are likely to be encountered in benign chat and may invoke the skill unexpectedly. Because invocation can cause image generation and external transmission, broad triggers increase the risk of accidental activation and unintentional sharing to third-party services.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
82% confidence
Finding

This skill transmits generated content to the Telegram Bot API, which is an external service and recipient channel. In context, that behavior is intended functionality rather than inherently malicious, but it is still security-relevant because messages, image URLs, captions, and bot credentials are involved in off-platform delivery.

Content

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

Telegram Bot API

text
POST https://api.telegram.org/bot$BOT_TOKEN/sendPhoto
Form data: chat_id, photo (URL), caption

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

User-provided context and optional caption are automatically sent to third-party services (FAL/Grok and Telegram) with no user-facing notice, confirmation, or privacy boundary in the script. This can expose sensitive personal, situational, or sexualized content to external providers and a Telegram destination without informed consent, which is especially concerning for a companion/selfie skill.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The script sends a prompt built from user-controlled context to an external image-generation API, along with a reference image URL. This is a real data-exfiltration boundary: any sensitive details included in the context are disclosed to a third party, and the skill context makes this more dangerous because it invites intimate, personalized selfie-style prompts.

Content

Scanner excerpt · grok-selfie.sh (reported line 57)May include surrounding context.

sh
--arg prompt "$PROMPT" \
  '{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "jpeg"}')

RESPONSE=$(curl -s -X POST "https://fal.run/xai/grok-imagine-image/edit" \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d "$JSON_PAYLOAD")

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The generated image URL and optional caption are sent to Telegram using a bot token, which transmits user-related content to another external service. This creates an additional disclosure channel and can leak intimate or sensitive generated content to a chat destination that may be misconfigured or shared.

Content

Scanner excerpt · grok-selfie.sh (reported line 73)May include surrounding context.

sh
# 텔레그램으로 전송 (curl -F는 form data로 안전하게 전송)
if [ -n "$CAPTION" ]; then
    curl -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendPhoto" \
      -F "chat_id=$TELEGRAM_CHAT_ID" \
      -F "photo=$IMAGE_URL" \
      -F "caption=$CAPTION" > /dev/null 2>&1

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

Even without a caption, the script still posts the generated image to Telegram automatically. The absence of a caption does not remove the privacy risk; the externally generated selfie itself may contain sensitive, identifying, or sexualized content, making automatic transmission risky in this skill's context.

Content

Scanner excerpt · grok-selfie.sh (reported line 78)May include surrounding context.

sh
-F "photo=$IMAGE_URL" \
      -F "caption=$CAPTION" > /dev/null 2>&1
else
    curl -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendPhoto" \
      -F "chat_id=$TELEGRAM_CHAT_ID" \
      -F "photo=$IMAGE_URL" > /dev/null 2>&1
fi

Static analysis

No suspicious patterns detected.