T09 · Insecure Skill Coding Practices
- Location
scripts/data_manager.md:9- Finding
Subscription Financial Metadata Is Persisted in an Unprotected Plaintext File
- Content
View full analysis
Vulnerability Details
File Location:
scripts/data_manager.md:9-38
Vulnerability Type: Plaintext storage of sensitive financial metadata
Risk Level: MediumVulnerable Code
markdown ## The State File All subscription facts must be stored in a file named `subscriptions.json` located in the current workspace directory. **Data Schema (`subscriptions.json`):** ```json { "last_scan_date": "YYYY-MM-DD", "active_subscriptions": [ { "service_name": "Netflix", "billing_amount": 15.99, "currency": "USD", "billing_cycle": "Monthly", "last_billing_date": "YYYY-MM-DD", "next_expected_billing_date": "YYYY-MM-DD" } ] }Mandatory Procedures
Procedure 1: Read State (Onboarding/Initialization)
Whenever the user queries their subscriptions, you MUST first read the contents of
subscriptions.jsonusing your file reading tool (e.g.,read_fileorcatviaexec). If the file does not exist, initialize an empty abstract state in your memory.Procedure 2: Write/Update State (Post-Inference)
After you have successfully ingested new email receipts and inferred the latest billing dates (completed Phase 2 of SKILL.md), you MUST update the state:
- Merge the newly inferred subscriptions with the existing data from Procedure 1.
- Update the
last_scan_date. - Overwrite
subscriptions.jsonentirely with the new combined JSON structure using your file writing tool (e.g.,write_fileorecho ... >viaexec).
text ### Technical Analysis The instructions require the agent to persist subscription information—including service names, billed amounts, currencies, billing cycles, and billing dates—in `subscriptions.json` in the current workspace. These fields reveal sensitive aspects of the user's financial activity. No encryption, restrictive file permissions, private storage location, retention period, deletion mechanism, ...[truncated 1903 chars]- Remediation
View remediation
Remediation Suggestions
- Obtain explicit user consent before retaining any financial metadata, and provide a mode that performs analysis without persistence.
- Store state in a dedicated per-user application-data directory rather than the current workspace or a source-controlled directory.
- Create the storage directory and file with owner-only permissions, such as
0700for the directory and0600for the file, where the platform supports them. - Encrypt persisted data at rest using a platform credential store or a key that is not stored alongside the state file.
- Minimize retained data. Avoid storing exact payment amounts and dates unless they are necessary, and document why each retained field is required.
- Define a retention period and provide clear deletion and state-reset procedures.
- Replace shell redirection with a structured file-writing API. Write to a protected temporary file in the same directory, validate the resulting JSON, apply restrictive permissions, and atomically rename it into place.
- Ensure that
subscriptions.jsonand temporary state files are excluded from version control, synchronization, diagnostic bundles, and logs. - Document the local disclosure risk so users can make an informed decision before enabling persistent state.
