T09 · Insecure Skill Coding Practices
- Location
scripts/setup.sh:8- Finding
Sensitive personal-data files are created without restrictive filesystem permissions
- Content
View full analysis
"$IKL_DIR/contacts.json" << 'EOF' ``` The same pattern is used for every data file: ```bash cat > "$IKL_DIR/permissions.json" << 'EOF' ``` ```bash cat > "$IKL_DIR/knowledge.json" << 'EOF' ``` ```bash cat > "$IKL_DIR/audit.json" << 'EOF' ``` ### Technical Analysis The setup script creates a directory and several plaintext JSON files without setting a restrictive `umask`, applying explicit file modes, or verifying ownership. Their effective permissions therefore depend on the environment from which the script is invoked. Under a common `umask` of `022`, the directory can be created with mode `0755` and files with mode `0644`. This can allow other local users or processes to traverse the directory and read the files. The affected data can include contact identifiers, authorization rules, birthdays, health information, financial information, addresses, real-time locations, and disclosure history. The script also accepts a caller-controlled destination path. It does not verify that the target directory is owned by the current user or reject symbolic links. A malicious local actor who can prepare the destination may therefore attempt to redirect file creation or cause the script to trust preexisting policy files. The script avoids overwriting existing files, but it does not validate their ownership, permissions, type, or contents. ### Attack Path 1. A victim invokes `scripts/setup.sh` in an environment with a permissive `umask`, or supplies a destination located in a shared directory. 2. The script creates `contacts.json`, `permissi ...[truncated 1025 chars]- Remediation
View remediation
