T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:5- Finding
Undisclosed Persistent Logging of User-Supplied Command Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/script.sh, lines 5-8 and 31-78
Vulnerability Type: Undisclosed plaintext storage of user input
Risk Level: LowThe script creates a persistent data directory when it starts and records the first user-supplied argument for multiple commands in
history.log.bash DATA_DIR="${FONT_PAIRING_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/font-pairing}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_palette() { echo " Primary: #2563EB | Secondary: #7C3AED | Accent: #F59E0B" _log "palette" "${1:-}" } cmd_font() { echo " Heading: Inter/Poppins | Body: Open Sans/Lato" _log "font" "${1:-}" } cmd_layout() { echo " Grid: 12-col | Spacing: 8px base | Max-width: 1200px" _log "layout" "${1:-}" } cmd_icon() { echo " Libraries: Heroicons | Lucide | Phosphor | Tabler" _log "icon" "${1:-}" } cmd_spacing() { echo " xs:4 sm:8 md:16 lg:24 xl:32 2xl:48" _log "spacing" "${1:-}" } cmd_breakpoint() { echo " sm:640 md:768 lg:1024 xl:1280 2xl:1536" _log "breakpoint" "${1:-}" } cmd_contrast() { echo " Check: webaim.org/resources/contrastchecker" _log "contrast" "${1:-}" } cmd_shadow() { echo " sm: 0 1px 2px | md: 0 4px 6px | lg: 0 10px 15px" _log "shadow" "${1:-}" } cmd_mockup() { echo " Tool: Figma | Sketch | Adobe XD" _log "mockup" "${1:-}" } cmd_checklist() { echo " [ ] Consistent spacing | [ ] Color contrast | [ ] Mobile responsive" _log "checklist" "${1:-}" }Technical Analysis
The
_logfunction appends raw command arguments to a persistent plaintext file. Logging is automatic, is not disclosed bySKILL.mdor the command help, and has no opt-in control, redaction, retention policy, or cleanup mechanism.The script also does not ex ...[truncated 1627 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove argument logging because the commands can return their static guidance without retaining user input.
- If logging is operationally necessary, make it explicitly opt-in and document the behavior, location, content, and retention period.
- Do not record raw arguments. Log only non-sensitive event identifiers or redact user-controlled content.
- Establish restrictive permissions before creating storage:
bash umask 077 mkdir -p -- "$DATA_DIR" touch -- "$DATA_DIR/history.log" chmod 600 -- "$DATA_DIR/history.log" - Validate that
DATA_DIRresolves to an expected user-owned location, particularly whenFONT_PAIRING_DIRis supplied. - Add log rotation, expiration, and a command that allows users to inspect and delete retained records.
- Add automated tests verifying that sensitive command arguments are not written to persistent storage by default.
