T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:6- Finding
Potentially Sensitive Log Files Are Created Without Restrictive Permissions
- Content
View full analysis
> "$DATA_DIR/history.log"; } ``` Representative command-specific log creation: ```bash else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/ingest.log" local total=$(wc -l < "$DATA_DIR/ingest.log") echo " [Bigdata] ingest: $input" echo " Saved. Total ingest entries: $total" ``` ### Technical Analysis The script creates its data directory and log files without explicitly applying restrictive permissions. Their resulting modes therefore depend entirely on the invoking process's `umask`. With a common `022` umask, the directory may be created as mode `0755` and log files as mode `0644`, allowing other local users to traverse the directory and read its contents. The Skill is designed to record queries, schemas, pipeline definitions, dataset names, profiling results, and arbitrary user-supplied text. These records may contain sensitive business information, internal infrastructure details, file paths, or accidentally supplied credentials. The files are also deliberately stored in plaintext. The same weakness affects `history.log` and all command-specific logs created through append redirection. ### Attack Path 1. A user invokes a logging command such as `bigdata query`, `bigdata schema`, or `bigdata pipeline` with sensitive operational information. 2. The script creates `~/.local/share/bigdata` and its log files using permissions inherited from the user's current `umask`. 3. Under a permissive `umask`, the directory and files become readable by other accounts on the same h ...[truncated 794 chars]- Remediation
View remediation
