- Location
- SKILL.md:67
- Finding
- Unprotected Plaintext Storage of Sensitive Relationship Data<![CDATA[
## Vulnerability Details
**File Location**: `SKILL.md:67-108`
**Vulnerability Type**: `T09: Insecure Skill Coding Practices`
**Risk Level**: Medium
### Vulnerable Code
```markdown
Store everything in a SQLite database at `~/.local/share/memi-ri/memi.db`. Create the database and all tables on first use if they don't exist.
### Tables
**contacts** — Core contact records.
Columns: `id` (integer primary key), `name` (text, required), `email`, `phone`, `company`, `role_title`, `how_met` (WHERE/WHAT context, never just "met"), `location`, `notes`, `interests` (comma-separated), `photo_path`, `relationship_score` (real, default 0), `relationship_status` (text: new/thriving/warming/stable/cooling/cold/lost, default 'new'), `mention_count` (integer, default 0), `last_mention_at` (ISO 8601), `score_updated_at`, `archived_at`, `created_at`, `updated_at`.
**contact_notes** — Structured notes with tags.
Columns: `id`, `contact_id` (foreign key), `content` (text), `tags` (comma-separated), `created_at`.
**contact_preferences** — Likes, dislikes, dietary info, gift ideas.
Columns: `id`, `contact_id`, `pref_type` (likes/dislikes/allergies/dietary/gift_ideas), `pref_value` (text), `created_at`.
**commitments** — Promises the user has made to people.
Columns: `id`, `contact_id`, `promise_text`, `status` (pending/completed/expired/cancelled, default 'pending'), `priority` (low/medium/high, default 'medium'), `due_date` (ISO 8601), `context` (original message), `created_at`, `updated_at`.
**interactions** — Log of all contact touchpoints.
Columns: `id`, `contact_id`, `interaction_type` (message/meeting/email/phone_call/note), `content`, `sentiment` (positive/neutral/negative), `created_at`.
**signals** — Extracted intelligence from any source (email, conversations, calendar).
Columns: `id`, `contact_id` (nullable), `signal_type` (life_event/commitment/topic/introduction), `content`, `source` (text — where this signal came from, e.g. "email from jake@stripe.com",
...[truncated 3064 chars]
- Remediation
- <![CDATA[
## Remediation Suggestions
1. Create `~/.local/share/memi-ri` with permissions limited to the owning user, such as mode `0700`.
2. Create the database with mode `0600` and verify permissions after creation.
3. Support encryption at rest using an appropriate encrypted SQLite implementation or application-level field encryption.
4. Store encryption keys in the operating system's secure credential store rather than beside the database.
5. Replace “store everything” with explicit data-minimization rules.
6. Require consent before retaining email-derived content or information about third parties.
7. Define configurable retention periods for interactions, signals, and inferred behavioral observations.
8. Provide export, selective deletion, and complete deletion controls.
9. Ensure soft-archived records can be permanently erased when the user requests deletion.
10. Avoid storing full message content when a minimal structured summary is sufficient.
11. Document backup and synchronization risks so users can exclude the database from insecure cloud backups.
12. Consider field-level protection for especially sensitive values such as phone numbers, private notes, allergies, and email-derived life events.
]]>