T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:6- Finding
Persistent sensitive records are created without explicit restrictive permissions
- Content
View full analysis
> "$DATA_DIR/history.log"; } ``` User-provided values are subsequently written to category-specific files using the same permission model. For example: ```bash local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/prompt.log" ``` ### Technical Analysis The skill persistently records prompts, configurations, evaluations, costs, benchmark results, and other command arguments in plaintext files under `~/.local/share/agent-learner`. Neither the storage directory nor the generated log files are assigned explicit restrictive permissions. `mkdir -p` and shell redirection create resources according to the process's ambient umask. Under a permissive umask, the directory or files may be readable by other local users. This is especially relevant because prompts and configuration records may contain internal instructions, proprietary data, endpoint details, tokens, or other secrets accidentally supplied by a user. The issue affects both the category logs and `history.log`, because `_log` duplicates user-provided content into the history file. No encryption, secret filtering, or permission verification is performed. ### Attack Path 1. The skill runs in an environment with a permissive umask or otherwise permissive permissions on the user's home data directories. 2. A user invokes a data command with sensitive content, such as: ```bash agent-learner prompt "Internal system prompt containing confidential information" ``` 3. The script writes the content to `prompt.log` and duplicates it in `history.log`. 4. Another local account that can traverse the relevant home directories reads the ...[truncated 755 chars]- Remediation
View remediation
