T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:5- Finding
Undisclosed Persistent Storage and Ineffective Data Removal
- Content
View full analysis
> "$DATA_DIR/history.log"; } ``` ```bash cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "${1:-}" } cmd_remove() { echo " Removed: $1" _log "remove" "${1:-}" } ``` ### Technical Analysis The script automatically creates a persistent data directory and writes user-supplied entries to `data.log`. It also records command activity in `history.log`. This persistence is not clearly disclosed by the skill documentation, which states that results are written to standard output. The `remove` command is functionally misleading: it reports that an entry was removed but never reads from or modifies `data.log`. Consequently, data that users believe has been deleted remains recoverable through direct filesystem access or subsequent `list`, `search`, and `export` commands. The files are created using the process's default `umask`, without explicit restrictive permissions. Depending on the execution environment and configured `umask`, stored household or personal information may be accessible to other accounts or processes with filesystem access. ### Attack Path 1. A user invokes `add` with household, schedule, address-related, or other personal information. 2. The script appends the information in plaintext to `data.log`. 3. The user invokes `remove` for that entry. 4. The script prints a successful removal message but does not alter `data.log`. 5. The retained entry can later be recovered using `list`, `search`, `export`, or direct access to the data file. 6. If local file permissions permit, another local ac ...[truncated 613 chars]- Remediation
View remediation
