T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:141- Finding
Sensitive Inputs Are Persisted in Plaintext Logs
- Content
View full analysis
/dev/null || echo " No entries yet. Use: awesome-pentest check-strength " else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/check-strength.log" local total=$(wc -l < "$DATA_DIR/check-strength.log") echo " [Awesome Pentest] check-strength: $input" echo " Saved. Total check-strength entries: $total" _log "check-strength" "$input" fi ;; ``` The shared storage and logging implementation is defined at lines 6–9: ```bash DATA_DIR="${HOME}/.local/share/awesome-pentest" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } ``` Equivalent plaintext behavior is repeated in handlers such as `generate`, `rotate`, `store`, `retrieve`, `hash`, and `verify`. ### Technical Analysis The `check-strength` command name reasonably implies that users may provide passwords, passphrases, or other authentication material. Instead of evaluating the input without retaining it, the handler writes the complete value to `check-strength.log`, prints it to standard output, and passes it to `_log`, which creates a second plaintext copy in `history.log`. Other security-related commands use the same generic implementation. In particular, `hash` does not hash its input, and `store` does not encrypt it. The files are created using the caller's current `umask`; the script does not explicitly enforce mode `0600` for files or mode `0700` for the data directory. The `recent`, `search`, and `export` features c ...[truncated 1255 chars]- Remediation
View remediation
