T09 · Insecure Skill Coding Practices
- Location
scripts/expense-tracker.sh:16- Finding
Financial Ledger Created Without Restrictive File Permissions
- Content
View full analysis
- Remediation
View remediation
"$LEDGER" fi chmod 600 -- "$LEDGER" ``` 4. Validate that the data directory and ledger are owned by the current user. Refuse to continue if either has an unexpected owner. 5. Reject symbolic links for the ledger before writing to it, reducing the risk of unintended writes if the storage path is manipulated: ```bash if [ -L "$LEDGER" ]; then echo "Refusing to use a symbolic-link ledger" >&2 exit 1 fi ``` 6. Apply these protections before any ledger creation, append, read, or deletion operation so that all commands use the same secured storage path. ]]>
