Back to skill

Security audit

Clear-Mind Skill (龙虾大脑自动清理技能)

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent memory-cleanup tool, but it can rewrite and delete persistent memory without a mandatory itemized approval plan or verified pre-migration backup.

Install only if you are comfortable letting the agent reorganize persistent memory files. Before using it, ask the agent to create a timestamped backup of MEMORY.md and memory/facts, show a dry-run list of every item to keep, move, rewrite, or delete, and require separate approval before deleting anything.

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
SKILL.md:31
Finding
Destructive Memory Migration Without Mandatory Plan Approval or Pre-Migration Backup## Vulnerability Details **File Location**: `SKILL.md`, lines 31-53 and 177-184 **Vulnerability Type**: Unsafe destructive file-management workflow **Risk Level**: Medium ### Evidence At lines 31-53, user confirmation is required only for the first-run category question. The subsequent rules explicitly permit deletion: ```markdown Wait for user confirmation before proceeding to Core Workflow. ## Content Migration Rules ### KEEP in MEMORY.md - **Core behavioral rules** (Honesty, Temporal Verification, etc.) — immutable principles - **Task index** (name + path only) — for navigation - **Quick Index table** — for factual information access - **Minimal architecture notes** — essential system structure - **All Technical Setup** — agent capabilities, installed skills, configs, tools that are frequently accessed. If it's about "what I can do," it stays. - **Any information that defines the agent's identity or capabilities** — this is core functionality ### MOVE to facts/ - **Historical events and incidents** — specific past occurrences - **Project details and statuses** — concrete project information - **Portfolio holdings** — specific investment data - **User preference lists** — specific user choices - **Scenario-specific information** — data relevant only to particular situations ### DELETE - **Redundant summaries** — information already captured elsewhere - **Outdated temporary notes** — expired or irrelevant information - **Information already in other systems** — duplicate data ``` At lines 177-184, creation of a backup is specified only after rollback has already been activated: ```markdown ### Rollback Workflow 1. **Assessment**: Determine which categories need to be restored 2. **Backup Current State**: Create backup of current MEMORY.md and facts/ directory 3. **Selective Restoration**: - **Specific Category**: Copy content from facts/ file back to MEMORY.md - **Entire Memory**: Restore from backup or rebuild from facts/ files 4. **Update Quic ...[truncated 2468 chars]
Remediation
## Remediation Suggestions 1. Require a dry-run plan before every mutation. The plan should list each item to retain, migrate, consolidate, or delete, together with its destination and rationale. 2. Require explicit user approval of that exact plan before creating, modifying, moving, or deleting any file. 3. Create a timestamped snapshot of `MEMORY.md` and the complete `memory/facts/` directory before applying changes. 4. Verify that the backup exists, is readable, and contains checksums matching the original files before proceeding. 5. Perform writes through temporary files and atomic replacement so interruption cannot leave partially written memory files. 6. Make deletion separately opt-in. By default, move deletion candidates to a recoverable quarantine file rather than permanently removing them. 7. After migration, compare the source inventory with retained, migrated, and quarantined content to ensure every original item is accounted for. 8. Automatically restore the pre-migration snapshot if validation fails. 9. Update `SKILL.md` so its executable workflow explicitly implements the plan-confirmation safeguard claimed by `README.md`. 10. Retain backups for a defined recovery period and obtain user approval before removing them.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Session Persistence

Medium
Category
Rogue Agent
Content
- **Conservative Migration Strategy**: When in doubt, keep information in MEMORY.md
- **User Confirmation**: Obtain explicit user approval at key steps
- **Comprehensive Verification**: Ensure core rules and capabilities are not affected
- **Rollback Mechanism**: Provide complete rollback capability to restore previous states when needed

These measures ensure that Clear-Mind skill optimizes agent memory files without affecting the core functions and capabilities of the AI assistant.
Confidence
55% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill directs deletion, migration, and consolidation of memory content without an explicit up-front warning that user data will be modified or removed. In a memory-management skill, this creates a real risk of unintended data loss or destructive changes being performed without sufficiently informed user consent.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The core workflow includes creating directories, migrating content, and rewriting MEMORY.md, but it lacks a prominent up-front disclosure that these are file-modifying operations. This is dangerous because a user may interpret the skill as advisory analysis when it actually performs state-changing actions that can alter persistent memory structure.

Whitespace Padding

Medium
Category
Prompt Injection
Content
Move factual details from MEMORY.md to appropriate facts/ files:

| Source Section      | Target File          | Migration Rule                                                                                |
|---------------------|----------------------|-----------------------------------------------------------------------------------------------|
| Critical Events     | critical-events.md   | Move full details, keep index link                                                            |
| Projects            | projects.md          | Move all project details                                                                      |
Confidence
70% confidence
Finding
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Natural-Language Policy Violations

Low
Confidence
18% confidence
Finding
The file includes a full Chinese translation after the English section, which indicates multilingual support rather than a forced language or locale. Because the skill does not require users to interact in only one language, this does not constitute a confident policy violation.

Intent-Code Divergence

Low
Confidence
78% confidence
Finding
L191 says an entire rollback can 'rebuild MEMORY.md from all facts/ files and core rules', which implies the facts/ files are a sufficient source of truth for restoring memory. But earlier guidance at L040-L041, L057-L064, and L113 says capabilities, installed skills, and technical setup must stay in MEMORY.md rather than being migrated, so rebuilding from facts/ alone would not fully restore that content.

Static analysis

No suspicious patterns detected.