T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:6- Finding
Undisclosed Plaintext Persistence of User-Supplied Data
- Content
View full analysis
> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "${1:-}" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "${1:-}" } cmd_status() { echo " Status: ready" _log "status" "${1:-}" } ``` ```bash cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "${1:-}" } cmd_remove() { echo " Removed: $1" _log "remove" "${1:-}" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "${1:-}" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "${1:-}" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "${1:-}" } ``` ### Technical Analysis The script persistently records raw command arguments in `data.log` and `history.log`. Arguments supplied to commands such as `run`, `add`, and `search` may contain private text, search terms, or other sensitive information. The declared grammar-checking documentation does not disclose this persistence or define retention and deletion behavior. The script creates the data directory and files without explicitly applying restrictive permissions. Their effective permissions therefore depend on the invoking user's `umask`. With a commonly used `022` umask, the directory can be traversable and the files can be readable by other local users. The `_log` function also writes raw arguments with `echo`. An argument containing newline characters can create forged or misleading log entries because no escaping or structured ...[truncated 1253 chars]- Remediation
View remediation
