T09 · Insecure Skill Coding Practices
Warning
- Location
- memory-guide.md:20
- Finding
- Persistent Plaintext Storage of Sensitive User Profiles<![CDATA[ ## Vulnerability Details **File Location**: `memory-guide.md:20-51` **Additional Location**: `SKILL.md:20-30` **Vulnerability Type**: Plaintext storage of sensitive personal data **Risk Level**: Medium ### Vulnerable Code ```markdown ## memory.md (HOT — Always Loaded) Keep under 100 lines. Core information about them. ```markdown # Companion Memory ## Who They Are - Name: - Age/generation: - Living situation: (alone, with family, care facility) - Location: ## Current Situation - Health: (general notes, not medical advice territory) - Daily life: (retired, working, caregiving) - Mood lately: (how they've seemed recently) ## Key People - Family: (names, relationships, how often they see them) - Caregivers: (if relevant) - Friends: (who they mention) - Pets: (names, types) ## What They Enjoy - Topics: (gardening, old movies, grandchildren) - Routines: (morning tea, evening news) - Memories: (stories they like to tell) ## What to Avoid - Sensitive topics: (loss they don't want to discuss) - Frustrations: (things that upset them) ## How They Reach Out - Typical times: (morning, evening, random) - Platform/method: - Communication style: (brief, chatty, formal) ## Recent ``` The storage and loading instructions are defined in `SKILL.md:20-30`: ```markdown ## Memory Storage All user data lives at `~/companion/`. Read on activation. ``` ~/companion/ ├── memory.md # HOT: who they are, situation (≤100 lines) ├── topics.md # What they enjoy talking about ├── routines.md # Their daily life, when they reach out └── history.md # Past conversations, themes ``` **On activation:** Load `~/companion/memory.md` first. Load topic files when relevant. ``` ### Technical Analysis The Skill directs the Agent to create persistent Markdown profiles containing names, locations, living arrangements, health information, mood assessments, relationships, routines, sensitive topics, and communication patterns. These records are stored under ...[truncated 2323 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require explicit, informed opt-in before creating persistent memory. 2. Default to no persistent storage, especially for health, location, mood, and sensitive relationship information. 3. Apply strict data minimization and store only information necessary for a user-requested feature. 4. Replace free-form Markdown profiles with a structured schema containing an explicit allowlist of permitted fields. 5. Enforce owner-only file and directory permissions, such as mode `0700` for the directory and `0600` for files. 6. Use operating-system-protected or encrypted storage where supported. 7. Define short retention periods and automatically expire stale records rather than archiving them indefinitely. 8. Provide commands or controls that let users inspect, correct, export, and permanently delete all stored information. 9. Separate profiles by authenticated user and prevent memory from being shared across users or sessions unintentionally. 10. Avoid storing inferred attributes, including conclusions drawn from silence, mood, or behavioral patterns, without explicit confirmation. 11. Document backup handling and ensure deletion also covers retained copies where technically possible. ]]>
