T09 · Insecure Skill Coding Practices
- Location
scripts/portfolio.py:45- Finding
Portfolio Data Stored Without Explicit Owner-Only Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a coherent A-share stock analysis and local portfolio tracker, with some privacy and deletion caveats users should understand.
Before using portfolio commands, understand that your stock codes, costs, quantities, and timestamps will be saved locally at ~/.clawdbot/skills/a-stock-analysis/portfolio.json. Use remove carefully because it updates that saved file immediately, and consider tightening file permissions if you share the machine with other local users.
scripts/portfolio.py:45Portfolio Data Stored Without Explicit Owner-Only Permissions
The skill explicitly documents state-changing portfolio commands (add, update, remove) but does not warn users that these operations persistently modify local data in ~/.clawdbot/skills/a-stock-analysis/portfolio.json. In an agent context, missing disclosure and confirmation around local file modification can lead to unintended data changes or loss, especially if the commands are invoked automatically or on behalf of a user.
This Python file contains natural-language descriptions, CLI help text context, and output strings entirely in Chinese, beginning with the module docstring and continuing throughout the script. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.
The script persists detailed portfolio holdings, including stock codes, quantities, costs, and timestamps, to a predictable file under the user's home directory without any notice, consent flow, or protection controls. In the context of a finance-related skill, this creates a privacy and confidentiality risk because sensitive investment data may be left on disk longer than the user expects and could be exposed to other local users, backups, or compromise of the host.
The remove command deletes a holding from the persisted portfolio file immediately once invoked. While the function prints a message after deletion, it does not warn or confirm the destructive action beforehand, so users are not given a chance to prevent accidental data loss.