T09 · Insecure Skill Coding Practices
Warning
- Location
- references/user_profile_template.md:9
- Finding
- Plaintext Persistence and Export of Sensitive Profile Data## Vulnerability Details **File Location**: `references/user_profile_template.md:9-28`, `references/user_profile_template.md:32-58`, and `references/user_profile_template.md:64-80` **Vulnerability Type**: Plaintext sensitive-data storage and unsafe full-profile export **Risk Level**: Medium The profile schema permits the storage of exact birth information, raw chart data, messaging-channel identifiers, and a partner's personal information in a plaintext `user_profile.json` file. ```json { "profileVersion": "1.0.0", "userId": "<value>", "name": "<value-or-empty>", "gender": null, "birth": { "date": "<YYYY-MM-DD>", "time": null, "place": null, "lunar": null }, "language": "zh", "chartRaw": null, "preferences": { "pushChannel": null, "pushTo": null, "morningTime": "07:00", "eveningTime": "21:00", "focus": [] }, "partner": { "name": null, "birthDate": null }, "createdAt": "<ISO timestamp>", "updatedAt": "<ISO timestamp>" } ``` The persistence rules direct the agent to place this profile in the skill root at `{baseDir}/user_profile.json`. They also direct the agent to echo the JSON content when the user requests an export. Although `pushTo` is explicitly identified as sensitive elsewhere in the same file, the export procedure does not require redaction or separate confirmation before returning the complete profile. ### Technical Analysis The core deterministic fortune calculation only requires a birth date. The optional schema nevertheless supports additional data such as birth time, birthplace, raw chart text, a channel identifier, and a partner's birth date. Combining these fields in one plaintext file increases both the sensitivity and consequences of disclosure. The documented write procedure does not require owner-only file permissions, encryption, or host-managed secure storage. The ...[truncated 2196 chars]
- Remediation
- ## Remediation Suggestions 1. Apply data minimization by storing only the birth date and preferences strictly required for the fortune calculation. 2. Require separate, explicit consent before persisting birth time, birthplace, raw chart data, partner information, or messaging-channel identifiers. 3. Move profile storage to host-managed secure application storage rather than the skill installation directory. 4. If filesystem storage remains necessary, create files with owner-only permissions such as `0600` and verify permissions after each write. 5. Add actual `.gitignore` and `.clawhubignore` files containing an explicit `user_profile.json` exclusion. 6. Redact `pushTo`, partner birth dates, raw chart data, and other sensitive values from ordinary exports. 7. Provide a separately confirmed full-export operation that clearly identifies which sensitive and third-party fields will be included. 8. Separate delivery credentials or channel identifiers from the general profile and store them through the runtime's secret or channel-management facility. 9. Validate profile paths and refuse symlinks before reading, writing, overwriting, or deleting the profile. 10. Document retention and deletion behavior and verify that deletion actually removes the intended profile without following attacker-controlled links.
