T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:93
- Finding
- Sensitive Information Migrated to Predictable Plaintext Files Without Mandatory Pre-Migration Backup## Vulnerability Details **File Location**: `SKILL.md`, lines 93-115; related deletion and backup instructions at lines 50-53 and 175-179 **Vulnerability Type**: Plaintext sensitive-data storage and unsafe destructive migration **Risk Level**: Medium ### Vulnerable Code ```markdown Ensure `/memory/facts/` exists with these files: ``` memory/facts/ ├── critical-events.md # Important incidents and lessons ├── projects.md # Active project statuses ├── technical-setup.md # DEPRECATED — technical configs now stay in MEMORY.md ├── portfolio.md # Stocks, investments, strategies └── user-directives.md # User preferences and instructions ``` **Note**: `technical-setup.md` is kept for backward compatibility. New technical content goes to MEMORY.md. ### Phase 3: Migrate 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 | | Technical Setup | technical-setup.md | **KEEP in MEMORY.md** — agent capabilities stay; only move niche/deprecated configs if requested | | Portfolio/Trading | portfolio.md | Move holdings, strategies | | User Directives | user-directives.md | Move preferences, quotes | ``` Related destructive behavior: ```markdown ### DELET ...[truncated 3923 chars]
- Remediation
- ## Remediation Suggestions 1. Require explicit, informed approval immediately before migrating each sensitive category, especially financial records, personal directives, and historical incidents. 2. Create a versioned backup of `MEMORY.md` and the complete `facts/` directory before every write, move, overwrite, or deletion operation. 3. Validate the backup by checking readability, file counts, and cryptographic hashes before proceeding. 4. Use an atomic migration transaction: write to a private temporary directory, validate content completeness, atomically rename files into place, and roll back automatically on any failure. 5. Prohibit deletion during automatic maintenance. Present proposed deletions to the user and require explicit confirmation. 6. Apply least-privilege file permissions to `MEMORY.md`, `facts/`, temporary files, and backups. Avoid shared or globally readable directories. 7. Detect and redact secrets such as credentials, tokens, private keys, account identifiers, and authentication data rather than moving them into additional plaintext files. 8. Minimize duplicated sensitive information and define retention periods for migrated records and backups. 9. Perform post-migration integrity checks to verify that all retained content is represented exactly once and that core rules, capabilities, and user directives remain intact. 10. Record an auditable migration manifest containing source section, destination, timestamp, checksum, and user authorization without logging the sensitive content itself.
