T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:7- Finding
Cache Data Stored in Plaintext Without Enforced Restrictive Permissions
- Content
View full analysis
"$CONFIG_FILE" fi ``` ### Technical Analysis The script creates its data directory, cache database, and configuration file without explicitly setting restrictive permissions. Their effective permissions therefore depend on the invoking process's `umask`. With a common `umask` of `022`, the directory may be created as `0755` and files as `0644`, allowing other local users to traverse the directory and read cached data. Cache values are serialized directly as plaintext JSON in `~/.cache-tool/data.jsonl`. The documented use cases include API responses and session data, which may contain tokens, personal data, or other sensitive content. No encryption or warning against storing credentials is provided. The script also does not verify that the cache paths are regular files rather than symbolic links. Although exploitation requires control over the relevant path or home-directory context, validating file types would provide additional defense against unintended file access. ### Attack Path 1. A user runs the Skill with a permissive `umask`, such as `022`. 2. The script creates `~/.cache-tool` and `data.jsonl` without applying explicit modes. 3. The user stores an API response, session value, token, or other sensitive data through the `set` or `import` command. 4. The value is written in plaintext to `~/.cache-tool/data.jsonl`. 5. On a multi-user system, another local account or process with filesystem access reads the cache file and obtains the stored values. Exploitation is limited to environments where another principal ...[truncated 614 chars]- Remediation
View remediation
