T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:6- Finding
Potentially Sensitive Records Stored with Ambient Filesystem Permissions
- Content
View full analysis
> "$DATA_DIR/history.log"; } ``` Representative record creation: ```bash run) shift if [ $# -eq 0 ]; then echo "Recent run entries:" tail -20 "$DATA_DIR/run.log" 2>/dev/null || echo " No entries yet. Use: macos-toolkit run " else 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") ``` ### Technical Analysis The script creates its data directory and log files without setting a restrictive `umask` or explicitly assigning secure permissions. File modes are therefore determined by the invoking process's ambient `umask`. With a commonly used `umask` of `022`, the directory may be created with mode `0755` and log files with mode `0644`. This can expose stored records to other local users if the parent home-directory permissions allow traversal. The project documentation encourages users to record system diagnostics, configuration changes, system states, and report contents. Such records can contain hostnames, internal paths, installed software details, operational metadata, configuration values, or accidentally supplied credentials. The same input is duplicated in category-specific logs and `history.log`, increasing the number of files that must be protected. The issue does not grant remote access or elevated privileges by itself. Exploitation requires local filesystem access and sufficient permission to traverse the affected user's home directory. ### Attack Path 1. A user invokes a recording command with sen ...[truncated 945 chars]- Remediation
View remediation
