T09 · Insecure Skill Coding Practices
- Location
scripts/add-transactions.sh:5- Finding
Sensitive Financial Records Created Without Restrictive Permissions
- Content
View full analysis
"$STORE" fi ``` ### Technical Analysis The script stores transaction dates, merchant names, monetary amounts, categories, source documents, and account metadata in a local JSON file. It does not establish a restrictive `umask` or explicitly set permissions on the finance directories and transaction file. Consequently, permissions depend entirely on the invoking process's environment. With a common `umask` of `022`, directories can be created as `0755` and the transaction file as `0644`. This may permit other local users to traverse the finance directories and read the financial records. The script also does not verify that existing storage paths are owned by the current user or that they are not symbolic links. ### Attack Path 1. A user invokes `add-transactions.sh` to import financial transactions. 2. The script creates the finance directories and `transactions.json` using the caller's default `umask`. 3. The resulting file is created with permissions that may allow access by other local users. 4. Another local account or process reads `~/.openclaw/workspace/finance/transactions.json`. 5. The attacker obtains the user's transaction history and any stored account metadata. ### Impact Assessment A local attacker may disclose sensitive financial information, including spending amounts, merchants, dates, categories, statement source names, and account details. The issue does not directly grant elevated system privileges, but it compromises the confidentiality of all fin ...[truncated 190 chars]- Remediation
View remediation
"$STORE" fi chmod 600 "$STORE" ``` 4. Before reading or replacing existing paths, verify that they: - Are owned by the effective user. - Are regular files or directories of the expected type. - Are not symbolic links. - Are not writable by group or other users. 5. Fail securely if the ownership or permissions do not meet these requirements. ]]>
