T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:5- Finding
Undisclosed Persistent Plaintext Storage of User-Supplied Data
- Content
View full analysis
Vulnerability Details
File Location:
scripts/script.sh:5-8,scripts/script.sh:30,scripts/script.sh:52-53, andscripts/script.sh:88-89
Vulnerability Type: Persistent plaintext storage and logging of potentially sensitive input
Risk Level: MediumVulnerable Code
bash DATA_DIR="${REVIEW_RESPONDER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/review-responder}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR"bash _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }bash cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "${1:-}" }bash run) shift; cmd_run "$@" ;; add) shift; cmd_add "$@" ;;Technical Analysis
The script creates a persistent data directory whenever it runs. Its
addcommand stores all supplied arguments indata.log, while_logrecords command data inhistory.log. Theruncommand also passes its first user-supplied argument to_log.The Skill is presented as a customer-review response assistant, so arguments may reasonably contain review text, customer identifiers, order details, complaint information, or other business data. The documentation does not disclose that the generic utility persists such input. The script does not redact sensitive fields, request explicit storage consent, define retention limits, or establish restrictive permissions through
umask 077or explicitchmodoperations. Resulting access permissions therefore depend on the caller's environment and inherited umask.Although
cmd_removereports that an item was removed, it does not alter either stored file:bash cmd_remove() { echo " Removed: $1" _log "remove" "${1:-}" }Consequently, users may incorrectly believe that stored information has been deleted.
Attack Path
- A user or agent invokes
scripts/script.shand supplies customer-review or order-rela ...[truncated 1484 chars]
- A user or agent invokes
- Remediation
View remediation
Remediation Suggestions
-
Remove
scripts/script.shif it is unrelated to the declared review-response functionality. -
Require explicit user consent before storing any supplied content, and clearly document the storage path, purpose, format, and retention period.
-
Avoid recording raw command arguments. Log only non-sensitive event metadata or redact customer identifiers, review content, order information, credentials, and tokens.
-
Create storage with restrictive permissions before writing files:
bash umask 077 mkdir -p -- "$DATA_DIR" touch -- "$DB" "$DATA_DIR/history.log" chmod 700 -- "$DATA_DIR" chmod 600 -- "$DB" "$DATA_DIR/history.log" -
Implement a functional deletion command that identifies and removes the requested record, verifies the result, and returns a failure status if deletion does not occur.
-
Add retention controls that automatically expire historical records and provide an explicit command to erase all stored data.
-
Validate
REVIEW_RESPONDER_DIRbefore use and document that changing it can direct stored data to another filesystem location. -
Add tests confirming that sensitive arguments are not logged, files receive restrictive permissions, and deletion actually removes the selected data.
-
