T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:34
- Finding
- Sensitive Dietary and Health-Related Data Persisted in a Predictable Plaintext File<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:34-62` **Vulnerability Type**: Plaintext storage of sensitive user data **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ## Memory Storage User data persists in `~/calories/memory.md`. Create on first use if it doesn't exist. **Format:** ```markdown # Calorie Tracker Memory ## Sources <!-- Where data comes from. Format: "source: what" --> ## Goal <!-- Their tracking goal. Format: "goal" --> <!-- Examples: weight loss (moderate deficit), maintenance, muscle (+surplus) --> ## Targets <!-- Daily targets if set. Format: "target" --> <!-- Examples: ~2000 cal, flexible, protein focus --> ## Patterns <!-- Eating patterns observed. Format: "pattern" --> ## Preferences <!-- How they want to track. Format: "preference" --> <!-- Examples: photos only, weekly summary, no daily numbers --> ## Library <!-- Saved foods for quick reuse. Format: "food: calories" --> <!-- Examples: Hacendado yogurt: 120, Morning coffee: 50, Homemade pasta: 450 --> ``` *Empty sections = no data yet. Observe and fill.* ``` ### Technical Analysis The skill instructs the agent to persist calorie targets, weight-related goals, eating patterns, tracking preferences, and food history in the predictable file `~/calories/memory.md`. These records may reveal sensitive health and behavioral information. No instruction requires encryption, owner-only file permissions, explicit user consent, data minimization, retention limits, or secure deletion. Consequently, the file's protection depends entirely on the runtime environment and its default file-creation permissions. If those defaults permit access by other local identities or processes, the stored profile can be disclosed. The predictable location also makes discovery straightforward for any actor that already has access to the user's home directory. The finding does not establish remote access or privilege escalation; exploitation requires an existing local proce ...[truncated 1098 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require explicit, informed user consent before enabling persistent storage. 2. Default to session-only storage and make persistence opt-in. 3. Store only fields required for the requested functionality; avoid retaining unnecessary meal history or health-related context. 4. Create the storage directory and file with owner-only permissions, such as directory mode `0700` and file mode `0600`, without relying on the ambient `umask`. 5. Use an approved encrypted storage mechanism when the execution environment supports secure key management. 6. Define a retention period and automatically delete stale records. 7. Provide commands or documented procedures that allow users to view, export, correct, and permanently delete stored information. 8. Avoid recording contraindication screening answers or other medical details unless strictly necessary and separately consented to. 9. Clearly disclose the storage path, stored fields, retention behavior, and potential backup or synchronization exposure before writing data. 10. Handle symbolic links and unexpected existing files safely so that writes cannot be redirected to unintended locations. ]]>
