T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:5- Finding
Profiling Data Is Stored Without Explicit Access Controls
- Content
View full analysis
> "$DATA_DIR/history.log"; } ``` A representative command writes supplied profiling data into this directory without setting file permissions: ```bash local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/run.log" local total=$(wc -l < "$DATA_DIR/run.log") echo " [Web Profiler Bundle] run: $input" echo " Saved. Total run entries: $total" _log "run" "$input" ``` ### Technical Analysis The script creates its data directory and log files using the invoking process's ambient `umask`. It does not set a restrictive `umask`, explicitly create the directory with mode `0700`, or ensure log files have mode `0600`. Consequently, environments with permissive defaults may create a directory accessible to other local users and logs that are group-readable or world-readable. The documentation encourages users to record HTTP routes, middleware behavior, database query details, configuration entries, and profiling results. Such records can contain internal endpoint names, identifiers, query text, infrastructure details, or credentials accidentally included in command input. This issue applies to `history.log` and the command-specific files, including `run.log`, `check.log`, `analyze.log`, `config.log`, and `report.log`. ### Attack Path 1. A user invokes the skill with sensitive profiling or configuration text. 2. The script creates `~/.local/share/web-profiler-bundle` and its log files under the user's current `umask`. 3. On a system with permissive default permissions, another local account traverses the directory and reads the log files. ...[truncated 701 chars]- Remediation
View remediation
