T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:4- Finding
Undisclosed Persistent 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 records the first argument supplied to most commands in `history.log`. The `add` command additionally records all supplied arguments in `data.log`. These writes occur without warning the user, filtering potentially sensitive values, defining a retention policy, or explicitly applying restrictive file permissions. This behavior conflicts with the documented expectation that results are sent to standard output. Users may therefore supply file paths, search terms, identifiers, tokens, or other sensitive strings without realizing that those values will remain on disk. The destination can be changed through `BROWSER_DEVTOOLS_DIR` ...[truncated 1821 chars]- Remediation
View remediation
