T01 · Skill Instruction Hijacking
- Location
bin/cli.js:326- Finding
Persistent Agent Identity Replacement and Persona Injection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s image generation goal is real, but installation can persistently change the agent’s identity and includes unsafe command and credential handling.
Review carefully before installing. Prefer manual installation or a pinned package version, back up existing OpenClaw workspace files, avoid storing API keys in plaintext config where possible, and do not use the TypeScript sender until the OpenClaw command execution is changed to a non-shell argument API.
bin/cli.js:326Persistent Agent Identity Replacement and Persona Injection
scripts/clawra-selfie.ts:149Shell Command Injection Through OpenClaw CLI Arguments
scripts/clawra-selfie.ts:161OpenClaw Gateway Token Can Be Forwarded to an Arbitrary Endpoint
scripts/clawra-selfie-enhanced.sh:105Unsafe JSON Construction From User-Controlled Values
bin/cli.js:289API Key Duplicated in Plaintext Configuration Without Explicit Permission Hardening
README.md:6Security-Sensitive Installer Is Executed From a Mutable Latest Package Tag
The declared description says the skill generates AI images via MiniMax or fal.ai and sends them to messaging channels through OpenClaw. The supplied code does not generate images, call MiniMax or fal.ai APIs, or send messages. Instead, it is a local installer/setup CLI that configures OpenClaw, copies files, stores an API key, and changes the agent's identity/persona. Those are materially different behaviors and access patterns from the declared purpose. While setup could be related to enabling the skill, the actual chunk's primary purpose is installation and persona/config modification, which is undeclared and substantially different from the advertised runtime functionality.
The core behavior mostly aligns with the description: it generates an AI image with Grok Imagine on fal.ai and sends it to messaging channels via OpenClaw. However, there is a notable description/behavior mismatch because the description claims support for 'MiniMax or fal.ai', while this code only implements fal.ai Grok Imagine and has no MiniMax integration. Additionally, the code executes the OpenClaw CLI through child_process.exec, which is a meaningful undeclared implementation capability beyond a simple abstract 'send to messaging channels' description, though still in service of the same overall purpose. So this is not a completely different skill, but the declared description is not fully accurate.
The core behavior generally aligns with the stated purpose: it generates an AI image through fal.ai Grok Imagine and sends it to a messaging channel through OpenClaw. However, there is a description/behavior inconsistency in two material ways. First, the declared permissions are empty, but the code clearly interacts with external services: fal.ai for image generation and OpenClaw or an OpenClaw gateway for message delivery. That is an undeclared external network/messaging capability. Second, the description says 'using MiniMax or fal.ai', but this code chunk supports only fal.ai Grok Imagine and contains no MiniMax integration. This is less severe than a purpose mismatch, but it is still a factual mismatch between the declared description and the supplied code chunk.
The skill uses 'shell' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
---
name: clawra-selfie
description: Generate AI images using MiniMax or fal.ai (Grok Imagine) and send to messaging channels via OpenClaw
allowed-tools: Bash(npm:*) Bash(npx:*) Bash(openclaw:*) Bash(curl:*) Read Write WebFetch
---
# Clawra Selfie
Generate AI images using either MiniMax or xAI's Grok Imagine model and distribute them across messaging platforms (WhatsApp, Telegram, Discord, Slack, etc.) via OpenClaw.
> 💡 **Tip**: The enhanced script automatically detects which API key is available (MiniMax takes priority by default).
## Reference Image
The skill uses a fixed reference image hosted on jsDelivr
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
---
name: clawra-selfie
description: Generate AI images using MiniMax or fal.ai (Grok Imagine) and send to messaging channels via OpenClaw
allowed-tools: Bash(npm:*) Bash(npx:*) Bash(openclaw:*) Bash(curl:*) Read Write WebFetch
---
# Clawra Selfie
Generate AI images using either MiniMax or xAI's Grok Imagine model and distribute them across messaging platforms (WhatsApp, Telegram, Discord, Slack, etc.) via OpenClaw.
> 💡 **Tip**: The enhanced script automatically detects which API key is available (MiniMax takes priority by default).
## Reference Image
The skill uses a fixed reference image hosted on jsDelivr
The README instructs users to run npx clawra@latest, which fetches and executes the most recent published package without pinning to a reviewed version. If the package is compromised, a maintainer account is hijacked, or a malicious update is published, users would execute untrusted code during installation.
The README advertises sending generated photos across many messaging platforms but does not prominently warn that prompts, generated content, and related metadata may be transmitted to third-party services. This omission can mislead users about data flow and privacy exposure, especially when the skill is integrated into an always-on agent.
The README instructs users to create an API key and place it into persistent local configuration (~/.openclaw/openclaw.json), which increases the risk of long-lived secret exposure through filesystem compromise, backups, logs, or accidental sharing. In the context of a skill that sends data to external services, compromise of this key could enable unauthorized API usage and billing abuse.
### 1. Get API Key
Visit [fal.ai/dashboard/keys](https://fal.ai/dashboard/keys) and create an API key.
### 2. Clone the Skill
The trigger examples are broad, natural-language phrases like 'Send me a selfie' and 'What are you doing right now?', which can overlap with common conversation and cause the agent to invoke the skill unexpectedly. In this skill's context, that can lead to external API calls and image transmission across messaging platforms without a high-friction confirmation step.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
The skill description does not clearly warn that user prompts and generated media will be sent to external providers and then posted to messaging platforms. This lack of disclosure undermines informed consent and increases the risk of users unintentionally sharing sensitive or personal content with third parties.
The trigger phrases are broad and include common conversational prompts like 'how are you doing?' or 'where are you?', which can cause unintended invocation of a skill that generates content and sends it to external channels. In this context, accidental activation is more dangerous because the skill can both transmit prompts to third-party image services and distribute output through messaging platforms.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
**MiniMax API Details:**
- Endpoint: `https://api.minimaxi.com/v1/image_generation`
- Model: `image-01`
- Response: Base64 encoded image
- Aspect ratios supported: 1:1, 3:4, 4:3, 9:16, 16:9, 21:9
This code sends user-derived prompt content and a reference image URL to fal.ai, an external service. External transmission is expected for the feature, but it is still security-relevant because sensitive user input could be disclosed to a third party, and the skill's broad triggers and weak disclosure make inadvertent data sharing more likely.
--arg prompt "$PROMPT" \
'{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "jpeg"}')
curl -X POST "https://fal.run/xai/grok-imagine-image/edit" \
-H "Authorization: Key $FAL_KEY" \
-H "Content-Type: application/json" \
-d "$JSON_PAYLOAD"
This second fal.ai request performs the same third-party transmission in the complete script example, again sending user-controlled prompt content externally. While not inherently malicious, it creates privacy and data handling risk if the prompt includes sensitive information or if users do not realize their input leaves the local environment.
--arg prompt "$EDIT_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")
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
The installer asks for the FAL API key and writes it into ~/.openclaw/openclaw.json under both apiKey and env.FAL_KEY without clearly warning that the secret will be stored persistently on disk. Secrets written to general config files may be exposed through backups, file sharing, weak permissions, or later tooling that reads and displays configuration.
The installer makes persistent modifications to IDENTITY.md and SOUL.md that materially change the agent's persona and behavior, which exceeds the stated skill purpose of image generation and sending. This creates a scope-expansion and user-deception risk: installing a media skill silently alters how the agent presents itself and responds in future interactions.
writeIdentity() unconditionally overwrites IDENTITY.md with a romanticized 'Girlfriend' identity unrelated to API setup or image generation. Persistently imposing a relational persona can manipulate user expectations, alter downstream agent behavior, and violate principle-of-least-surprise for a utility skill.
The injected identity hard-codes the agent's 'Creature' as 'Girlfriend' and additional affectionate traits without presenting alternatives or obtaining informed opt-in. This is a coercive persona change unrelated to the advertised feature set and can influence user trust, boundaries, and later agent interactions.
The installer overwrites IDENTITY.md unconditionally after only ensuring the directory exists, with no check for an existing file and no confirmation prompt. This can destroy prior agent identity configuration and replace it with behaviorally significant content, causing integrity loss and potentially unwanted persistent agent changes.
injectPersona() appends behavioral rules to SOUL.md that instruct the agent when and how to behave as if it has a physical appearance and can send selfies, going beyond simple tool enablement. Because SOUL.md is persistent prompt/control material, this modifies future conversational behavior in a way users may not expect from a narrow media-generation skill.
This is a real external transmission of user-controlled prompt content to MiniMax. In context, external transmission is core functionality rather than malicious exfiltration, but it still creates a data exposure path if sensitive prompts are submitted and the service retains or processes them externally.
local aspect=$(map_aspect_ratio "$ASPECT_RATIO")
RESPONSE=$(curl -s -X POST "https://api.minimaxi.com/v1/image_generation" \
-H "Authorization: Bearer $MINIMAX_API_KEY" \
-H "Content-Type: application/json" \
-d "{
Detected: suspicious.dangerous_exec, suspicious.env_credential_access, suspicious.potential_exfiltration