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.
