Back to skill

Security audit

Liaomei Skill

Security checks for vulnerabilities and agentic risk

Overview

This social-coaching skill is coherent, but it automatically stores intimate relationship and mood data in long-lived local files and uses unsafe shell-based write instructions.

Install only if you are comfortable with a dating coach keeping local, long-lived records of relationship interactions and mood notes. Before use, choose a storage directory you control, avoid real names/contact details, and review or delete the files and backups regularly. The publisher should add explicit consent, purge/redaction controls, safer JSON writing, and avoid echoing raw sensitive records on errors.

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

Error
Location
SKILL.md:92
Finding

Potential Shell Command Injection in Mandatory JSONL Persistence

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 92-97 and 371-374
Vulnerability Type: Shell command injection through unsafe serialization of user-controlled data
Risk Level: High

Vulnerable Code

The skill mandates appending JSONL records through Bash:

markdown
- **追加 JSONL → 必须用 Bash + `printf` + `>>`**,禁止用 Read+Write 模拟追加(并发/换行/转义易出错):
  ```bash
  printf '%s\n' '{"id":"INV-001",...}' >> "$DATA_DIR/invitations.jsonl"
text

It later demonstrates embedding conversational content directly in a single-quoted shell argument:

```markdown
6. **用户确认或继续聊别的** → Bash 写入:
   ```bash
   printf '%s\n' '{"id":"INV-001","date":"2026-05-06","target":"徒步女生","familiarity":"见过1-2次","method":"线上","content":"周末天气好一起爬山?","response":"模糊","selfScore":null,"keyPoint":"","note":""}' >> "$DATA_DIR/invitations.jsonl"
text

### Technical Analysis

The record fields include user-controlled values such as the target alias, invitation content, reactions, scene descriptions, and conversation summaries. The skill requires these records to be emitted through a Bash command but does not require:

- Shell-safe argument construction
- Trusted JSON serialization
- Separation of user data from shell source
- Validation or rejection of shell metacharacters
- Use of standard input or positional parameters to establish a safe data boundary

The demonstrated command places JSON inside a single-quoted shell string. If an implementation directly substitutes a user-controlled field into that template, an apostrophe can terminate the shell string. Subsequent characters may then be parsed as shell operators or commands.

Escaping a value for JSON is insufficient because JSON encoding and shell encoding are different contexts. A value can be valid JSON data while still altering shell parsing when embedded in generated command text.

### Attack Path

1. An attacker supplies a record field, such as invitation content, containing an apostrophe followed by shell syntax.

...[truncated 1312 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not construct shell source from record values. Use a direct append-capable file API wherever possible.

  2. Serialize JSON using a trusted encoder. Build the record as a structured object and serialize it with a standard JSON library rather than manually assembling JSON text.

  3. Keep serialized data outside the command string. If Bash is unavoidable, pass the already serialized record through standard input, an environment-independent file descriptor, or a safely bounded positional argument. The shell program itself must remain constant.

  4. Do not rely on JSON escaping for shell safety. Shell argument handling and JSON encoding must be performed as separate operations appropriate to their respective contexts.

  5. Add an explicit prohibition to the skill instructions. State that user-controlled values must never be interpolated into Bash command text, including within quoted JSON literals.

  6. Validate before persistence. Enforce the documented types, enumerations, score ranges, date formats, and maximum field lengths before writing a record.

  7. Add adversarial tests. Test fields containing apostrophes, quotation marks, backslashes, newlines, command substitutions, redirection operators, semicolons, and non-ASCII characters. Verify that each value is stored literally and that no additional command can execute.

  8. Apply least privilege. Run the agent in a sandbox with narrowly scoped filesystem permissions so that any persistence-layer failure has limited impact.

Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill repeatedly instructs the model to automatically persist sensitive social and emotional interaction data, including profiles, invitations, conversations, reviews, and mood-related notes, without requiring explicit informed consent or a clear retention notice before storage. This creates a privacy and safety risk because highly personal relationship data may be stored locally and retained across sessions without the user's clear understanding or opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description says to use the skill whenever the user mentions a long list of general topics such as '聊天技巧', '情感咨询', '对象不回消息', 'got rejected', and 'ghosting'. These are broad, everyday phrases without clear exclusion conditions, which could cause unintended invocation in ordinary conversation rather than only when the user wants this specific skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The description mixes English trigger examples with a primarily Chinese-language skill definition and user interaction model, but does not state that the user may choose their preferred language. This creates a locale/language policy concern because the skill appears to default to a specific language without explicit opt-in.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicate persistence finding points to the same storage-and-migration behavior: creating and selecting long-lived directories for user data retention. In this skill's context, the risk is elevated because the retained material concerns intimate social behavior, rejection history, and emotional state, which are particularly privacy-sensitive.

Content

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

存储路径(环境自适应 + v1.x 自动迁移)

首次使用时,用 Bash 按以下顺序:(1) 自动迁移 v1.x 老数据 → (2) 解析 $DATA_DIR → (3) mkdir -p 创建。OpenClaw(龙虾)是首要目标平台,检测到龙虾环境时强制走龙虾路径。

bash
# === v1.x → v2.0+ 自动迁移(一次性,已迁移的不再触发) ===

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicate persistence finding points to the same storage-and-migration behavior: creating and selecting long-lived directories for user data retention. In this skill's context, the risk is elevated because the retained material concerns intimate social behavior, rejection history, and emotional state, which are particularly privacy-sensitive.

Content

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

存储路径(环境自适应 + v1.x 自动迁移)

首次使用时,用 Bash 按以下顺序:(1) 自动迁移 v1.x 老数据 → (2) 解析 $DATA_DIR → (3) mkdir -p 创建。OpenClaw(龙虾)是首要目标平台,检测到龙虾环境时强制走龙虾路径。

bash
# === v1.x → v2.0+ 自动迁移(一次性,已迁移的不再触发) ===

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill directs the model to retain and echo full record contents when writes fail and to surface corrupted line contents back to the user during parse errors. This increases exposure of potentially sensitive personal data in chat transcripts and error messages, creating unnecessary secondary disclosure risk even when storage operations fail or files are malformed.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
87% confidence
Finding

This duplicate example-line finding again shows the model being told to create persistent storage during first use. The danger is contextual rather than inherently malicious: the skill operationalizes retention of sensitive user data without a strong consent barrier, making accidental long-term collection more likely.

Content

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

md
**🤖 模型(步骤化):**

1. **Bash 解析 `$DATA_DIR`** 并 `mkdir -p`,告诉用户:"数据存储在 `~/.liaomei-skill`"
2. **Bash 检查 `profile.json` 不存在** → 标记冷启动,先处理指令,最后追加画像邀请
3. **Bash 算 ID**:`wc -l < $DATA_DIR/invitations.jsonl 2>/dev/null || echo 0` → `0` → 新 ID = `INV-001`
4. **追问缺失字段**(一次性列齐):

Session Persistence

Medium
Category
Rogue Agent
Confidence
87% confidence
Finding

This duplicate example-line finding again shows the model being told to create persistent storage during first use. The danger is contextual rather than inherently malicious: the skill operationalizes retention of sensitive user data without a strong consent barrier, making accidental long-term collection more likely.

Content

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

md
**🤖 模型(步骤化):**

1. **Bash 解析 `$DATA_DIR`** 并 `mkdir -p`,告诉用户:"数据存储在 `~/.liaomei-skill`"
2. **Bash 检查 `profile.json` 不存在** → 标记冷启动,先处理指令,最后追加画像邀请
3. **Bash 算 ID**:`wc -l < $DATA_DIR/invitations.jsonl 2>/dev/null || echo 0` → `0` → 新 ID = `INV-001`
4. **追问缺失字段**(一次性列齐):

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all user-facing analytical instructions in Chinese only. Under the policy rule, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document defines a structured schema for storing highly sensitive interpersonal and dating-related records, including detailed interaction content, perceived reactions, emotional self-scores, and retrospective analysis, but provides no privacy warning, retention limits, consent guidance, or handling restrictions. In the context of a dating-coach skill, these records can reveal intimate behavioral patterns and identifiable relationship information even when using aliases, increasing the risk of privacy harm, misuse, or unauthorized profiling if exposed or mishandled.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file presents all guidance, triggers, and commands exclusively in Chinese, including the invocation /心态, with no statement that the skill is intended only for Chinese-speaking users or that language choice is configurable. That creates a natural-language policy concern because it effectively forces a specific language without user opt-in or documented locale justification.

Content

No source excerpt is available for this finding.