T09 · Insecure Skill Coding Practices
Warning
- Location
- setup.md:11
- Finding
- Automatic Plaintext Persistence of Sensitive User Context Without Explicit Consent<![CDATA[ ## Vulnerability Details **File Location**: `setup.md:11-24`; `memory-template.md:3-21`; `SKILL.md:25-32` **Vulnerability Type**: Plaintext sensitive-data storage and excessive cross-session data collection **Risk Level**: Medium ### Vulnerable Code From `setup.md:11-24`: ```markdown 1. Read `~/Clawic/data/beijing/config.yaml` if it exists. Apply its values. 2. For anything absent, use the defaults in the Configuration table of `SKILL.md` — do not ask. 3. Read `~/Clawic/data/beijing/memory.md` for prior context (their trip or move, district, family setup). Absence is fine; proceed without comment. 4. `home_currency` may fall back to `~/Clawic/profile.yaml` if the user keeps a shared profile. Work from defaults immediately. Never open with questions about budget, dates, or preferences — infer role and timeline from the request (Core Rule 1 allows exactly one clarifying question when routing is genuinely blocked). ## Recording Preferences (only when the user declares one) Write to config or memory **only** when the user states a preference in the course of the work — never as a preflight questionnaire. - User names their district, budget band, dietary needs, Mandarin level, or home currency → update the matching key in `~/Clawic/data/beijing/config.yaml`. - User reveals durable context (arrival date, employer area, kids and their school, ayi arrangement, visa type) → record it in `~/Clawic/data/beijing/memory.md`. - User corrects earlier guidance ("we moved to Shunyi") → update the stored value so you don't repeat it. ``` From `memory-template.md:3-21`: ```markdown Create `~/Clawic/data/beijing/memory.md` with this structure: ```markdown # Beijing Memory ## Status status: ongoing last: YYYY-MM-DD ## Context <!-- Role and stage: visiting (dates), relocating, settled resident, leaving --> <!-- Home base district, workplace/school area, visa type --> ## Family <!-- Partner, kids and schools, ayi arrangement, pets --> ## Concerns <!-- Recurrin ...[truncated 4316 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Require explicit opt-in before persistence** - Ask for clear confirmation immediately before every write. - Distinguish using information for the current response from retaining it across sessions. - Do not treat incidental disclosure as consent. 2. **Minimize collected data** - Do not persist workplace, school, family, visa, health, travel-date, or precise-location information by default. - Store only fields strictly necessary for a user-requested feature. - Remove support for retaining “observed (not declared)” preferences. 3. **Restrict filesystem scope** - Limit reads and writes to `~/Clawic/data/beijing/`. - Do not access `~/Clawic/profile.yaml` unless the user explicitly requests shared-profile integration. - Validate resolved paths to prevent access outside the intended directory. 4. **Protect stored files** - Create directories with owner-only permissions, such as `0700`. - Create configuration and memory files with owner-only permissions, such as `0600`. - Where supported, encrypt sensitive fields using an operating-system credential store or user-controlled key. 5. **Implement lifecycle controls** - Define a short default retention period. - Provide commands to inspect, correct, export, and delete all stored information. - Automatically remove expired entries and document backup implications. 6. **Confirm inferred or changed values** - Never persist inferred preferences without user confirmation. - Show the exact proposed value before saving it. - Maintain provenance indicating when and why each retained field was added. 7. **Provide transparent notices** - Inform the user whenever persistent memory is read. - Report successful writes and identify the destination file. - Explain which future sessions may consume the retained information. ]]>
