T09 · Insecure Skill Coding Practices
- Location
src/storage.js:37- Finding
Sensitive journal data is created without restrictive filesystem permissions
- Content
View full analysis
{ if (!fs.existsSync(file)) { fs.writeFileSync(file, ''); } }); // Create index if it doesn't exist if (!fs.existsSync(this.indexFile)) { fs.writeFileSync(this.indexFile, JSON.stringify({ decisions: [], reviews: [], tags: {}, stats: { totalDecisions: 0, totalReviews: 0, lastUpdated: null } }, null, 2)); } // Create patterns file if it doesn't exist if (!fs.existsSync(this.patternsFile)) { fs.writeFileSync(this.patternsFile, JSON.stringify({ patterns: [] }, null, 2)); } } ``` ### Technical Analysis The application stores decision titles, personal context, reasoning, expected outcomes, reviews, lessons, and behavioral patterns under `~/.openclaw/decisions`. Neither the storage directory nor its files are created with explicit restrictive permission modes. Consequently, permissions are determined by the process umask. On Unix-like systems using a common umask such as `022`, the directory may be created with mode `0755` and files with mode `0644`. This can permit other local users to traverse the directory and read sensitive journal records. The implementation also uses separate existence checks followed by file creation. It does not verify ownership, reject symbolic links, or ensure that an existing storage path is a regular file owned by the current user. In a shared or improperly configured environment, this can increase the risk of local disclosure or unintended writes. ### Attack Path 1. A user runs the decision journal under a permissiv ...[truncated 1032 chars]- Remediation
View remediation
