T09 · Insecure Skill Coding Practices
- Location
SKILL.md:31- Finding
Destructive Memory Migration Without Mandatory Plan Approval or Pre-Migration Backup
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 31-53 and 177-184
Vulnerability Type: Unsafe destructive file-management workflow
Risk Level: MediumEvidence
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 dataAt 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
View remediation
Remediation Suggestions
- 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.
- Require explicit user approval of that exact plan before creating, modifying, moving, or deleting any file.
- Create a timestamped snapshot of
MEMORY.mdand the completememory/facts/directory before applying changes. - Verify that the backup exists, is readable, and contains checksums matching the original files before proceeding.
- Perform writes through temporary files and atomic replacement so interruption cannot leave partially written memory files.
- Make deletion separately opt-in. By default, move deletion candidates to a recoverable quarantine file rather than permanently removing them.
- After migration, compare the source inventory with retained, migrated, and quarantined content to ensure every original item is accounted for.
- Automatically restore the pre-migration snapshot if validation fails.
- Update
SKILL.mdso its executable workflow explicitly implements the plan-confirmation safeguard claimed byREADME.md. - Retain backups for a defined recovery period and obtain user approval before removing them.
