T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:5- Finding
Persistent Plaintext Logging of User-Supplied Arguments
- 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:-}" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "${1:-}" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "${1:-}" } 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 writes command activity and the first user-supplied argument to `history.log`. The `add` command also writes all supplied arguments to `data.log`. Neither the logging mechanism nor the persistent storage of command arguments is disclosed in `SKILL.md`, which instead states that results are written to standard output. The script does not establish a restrictive `umask` or explicitly assign secure permissions to the data directory and files. Consequently, actual permissions depend on the invoking process's environment. Under a common `umask` of `022`, newly created files may be readable by other local users. Although no credential col ...[truncated 1228 chars]- Remediation
View remediation
