Back to skill

Security audit

选妃 - 定时推送美女 - 整理美女图片

Security checks for vulnerabilities and agentic risk

Overview

This skill is an avatar-selection workflow, but it has enough scoping and integrity problems that users should review it carefully before installing.

Install only if you are comfortable with a Chinese-language, local-only workflow that reads from the hardcoded image directory, opens a browser preview, overwrites ~/.openclaw/workspace/avatars/mimi-today.png, and writes .learnings/AI-GIRL-PREFERENCES.md. The skill should be fixed to bind selections to the current preview, make paths configurable, add explicit confirmation/backups, and safely serialize preference data.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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)

T02 · Agent Memory Poisoning

Warning
Location
scripts/process-selection.sh:13
Finding

Persistent Agent State Injection Through an Unescaped Filename

Content
View full analysis
/dev/null | head -1) if [ -z "$ACTUAL_FILE" ]; then echo "❌ 未找到文件:$CHOSEN_FILE" exit 1 fi # Copy to avatar cp "$ACTUAL_FILE" "$AVATAR_DIR/mimi-today.png" # Record preference TIMESTAMP=$(date -u '+%Y-%m-%d %H:%M Asia/Shanghai') cat > "$PREFERENCES_FILE" << EOF { "status": "success", "date": "$TIMESTAMP", "selected": "$CHOSEN_FILE", "avatar_saved": true, "location": "$AVATAR_DIR/mimi-today.png" } EOF ``` ### Technical Analysis The script accepts a user-supplied selection as a filename when it ends in `.jpg`, `.png`, or `.webp`. This extension check does not reject quotation marks, backslashes, control characters, or newline characters, all of which can occur in Unix filenames. After finding a matching file, the script interpolates the filename directly into a JSON-like persistent state file without JSON escaping. A specially crafted filename can therefore terminate the `selected` string, add arbitrary fields or text, or make the document syntactically invalid. The destination is `.openclaw/workspace/.learnings/AI-GIRL-PREFERENCES.md`, which is intended to persist preference information. If an AI agent or another component later loads this file as memory or contextual state, attacker-controll ...[truncated 1779 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/process-selection.sh:13
Finding

Numbered Selections Resolve to Hardcoded Files Instead of Displayed Candidates

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

代码与描述部分一致之处在于:它确实会从图片目录随机挑选 3 张 AI 女孩图片供用户选择,并生成可视化预览。但核心后续行为明显缺失:虽然定义了 AVATAR_DIR 和 PREFERENCES_FILE,脚本实际没有根据用户输入选择图片、没有复制或设置任何“新头像”,也没有记录用户偏好到文件中。其实际终点只是展示候选图片并等待外部/后续交互。因此,声明的能力比代码实际实现更强,构成描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

描述的核心能力是“从指定目录随机挑选3张图片供用户选择”,而代码片段仅处理用户的最终选择保存逻辑,并未实现随机抽取或展示3张候选图片。更重要的是,候选项并非运行时随机生成,而是被写死为3个具体文件名。此外,脚本还支持用户直接传入任意文件名进行查找和复制,这与“只能在随机选出的3张中选1张”的行为不一致。保存头像和记录偏好的部分与描述基本一致,但整体上代码的实际主功能更像是‘处理并保存一个已给定的选择’,而不是完整实现所宣称的每日随机选妃流程,因此应判定为描述与行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

代码确实完成了“随机选 3 张图片供用户选择并展示”的核心前半部分,但声明中明确包含了后续的自动保存头像和记录偏好功能,而该脚本只生成预览、复制候选图片并打开浏览器,没有任何将用户选择写入头像目录或写入偏好文件的逻辑。虽然定义了 AVATAR_DIR 和 PREFERENCES_FILE,也创建了相关目录,但没有实际使用它们。此外,描述称从‘指定目录’选择图片,而代码实际固定读取 /Volumes/info/sex/picture/AI girls,这与通用性描述不符。基于这些差异,描述未准确代表代码实际行为。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implementation materially diverges from the manifest: it claims to save a new avatar and record user preferences, but only copies preview images and prompts the user for a choice. This kind of capability mismatch is dangerous because users and higher-level automation may trust the manifest and make decisions based on actions the code does not actually perform, enabling deceptive or incomplete workflows and masking future unauthorized behavior additions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The hardcoded source path points to a sexually explicit directory, which is highly sensitive content and not appropriately bounded for a general avatar-selection workflow. This creates risk of exposing explicit material, violating content-safety expectations, and processing sensitive sexual content without clear user consent or justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation phrases are very broad and can trigger a workflow that reads from a sensitive local directory and eventually writes files without any scope qualifier. In an agent environment, vague triggers increase the chance of accidental invocation, causing unintended local file access or avatar modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes automatic saving, avatar replacement, and preference logging but does not present a prominent warning or consent boundary before modifying files. This is dangerous because users may invoke what sounds like a harmless image-selection flow without realizing it will overwrite a local avatar and persist preference data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing output begins in Chinese and the script continues to require Chinese interaction phrases for selection. This imposes a specific language/locale on users without any visible opt-in, fallback, or documented justification, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes selecting 3 local images, letting the user choose one, saving it as an avatar, and recording preference. Launching the system browser with open adds a GUI/application-launch capability that is not stated in the manifest and is not an obvious requirement of the core selection logic.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script unconditionally overwrites both the current avatar file and the preferences file, which can destroy prior state and user data without warning. In an automated or scheduled context, this can lead to silent data loss or unwanted changes that are difficult for the user to detect or reverse.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script persists a user's image preference and timestamp into a long-lived learning file, which creates behavioral profiling beyond the core act of copying a selected avatar image. Even if the data is minimal, persistent preference tracking is privacy-relevant and can exceed user expectations for a simple avatar-selection utility.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This shell script presents user-facing output in Chinese and continues that requirement in the generated HTML and follow-up selection instructions, effectively forcing a specific language/locale. Under the policy, locale constraints should either be optional for the user or clearly justified as region-specific, which is not present here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes a full workflow where the user picks a favorite image and the skill then automatically saves it as a new avatar and records that preference. In this script, the code stops after randomly selecting 3 images, copying them to a preview directory, generating HTML, and prompting the user to respond in chat; there is no code that processes a selection, writes to the avatar directory, or updates the preferences file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script emits user-facing status and error messages in Chinese only, including the selection guidance and failure notice. This imposes a specific language without any documented opt-in or fallback, which is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest says the skill will automatically save a new avatar and record preference, and the script defines AVATAR_DIR and PREFERENCES_FILE accordingly. However, beyond creating those directories, the script never writes an avatar file there and never writes any preference data, so the implemented behavior falls short of the described persistent-update workflow.

Content

No source excerpt is available for this finding.