T09 · Insecure Skill Coding Practices
- Location
SKILL.md:296- Finding
Plaintext Storage and Destructive Reinitialization of Sensitive Personal Records
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 208-209 and 296-325
Vulnerability Type: Plaintext sensitive-data storage, insufficient file-permission hardening, and unsafe file overwrite
Risk Level: MediumThe skill stores behavioral, emotional, habit, and personal-reflection data in a predictable plaintext JSON file:
markdown ### Storage Location `~/.openclaw/data/evolution档案.json`Initialization uses the following shell operation:
bash mkdir -p ~/.openclaw/data cat > ~/.openclaw/data/evolution档案.json << 'EOF' { "initialized_at": "{{Current time}}", "last_update": "{{Current time}}", "profile": { "name": "大表哥", "streaks": { "早起": {"current": 0, "best": 0, "last_date": ""}, "运动": {"current": 0, "best": 0, "last_date": ""}, "阅读": {"current": 0, "best": 0, "last_date": ""}, "写作": {"current": 0, "best": 0, "last_date": ""}, "冥想": {"current": 0, "best": 0, "last_date": ""}, "学习": {"current": 0, "best": 0, "last_date": ""}, "复盘": {"current": 0, "best": 0, "last_date": ""} } }, "heartflow": [], "troughs": [], "daily_mood": {}, "achievements": [], "weekly_letters": [], "stats": { "total_heartflow_hours": 0, "total_troughs": 0, "current_best_streak": 0, "total_achievements": 0 } } EOFTechnical Analysis
The archive may contain sensitive information such as mood scores, emotional low points, personal reflections, habits, achievements, and weekly letters. The initialization procedure does not establish restrictive permissions for either the directory or the JSON file. Actual permissions consequently depend on the process umask and preexisting filesystem state.
On systems with a permissive umask, other local accounts or processes may be able to read the archive. The predictable path also makes the data easy to locate. Plaintext storage further means ...[truncated 1816 chars]
- Remediation
View remediation
Remediation Suggestions
-
Create the data directory with owner-only permissions:
bash install -d -m 0700 "$HOME/.openclaw/data" -
Set a restrictive umask before creating or updating the archive:
bash umask 077 -
Ensure the archive is owner-readable and owner-writable only:
bash chmod 0600 "$HOME/.openclaw/data/evolution档案.json" -
Do not overwrite an existing archive silently. Test for its existence and require explicit user approval:
bash archive="$HOME/.openclaw/data/evolution档案.json" if [ -e "$archive" ]; then printf '%s\n' "Archive already exists; initialization aborted." >&2 exit 1 fi -
Before any approved reset, create a timestamped backup with restrictive permissions and clearly inform the user that initialization will replace existing records.
-
Write updates to a securely created temporary file in the same protected directory, validate the JSON, set mode
0600, and atomically rename it over the destination. This reduces corruption from interrupted writes. -
Consider encryption at rest for emotional and personal-reflection fields, with keys stored separately from the archive. Clearly document that local-only storage does not by itself guarantee confidentiality against other processes running with the user's privileges.
-
Validate that
~/.openclaw/dataand the archive are not symbolic links before writing, particularly if directory permissions may have been altered by another process.
-
