T09 · Insecure Skill Coding Practices
- Location
scripts/analyze_decision.py:9- Finding
Personal Decision Data Stored in Plaintext Without Explicit Access Controls
- Content
View full analysis
Vulnerability Details
File Location:
scripts/analyze_decision.py, lines 9-13 and 54-72
Vulnerability Type: Plaintext storage of potentially sensitive user data with insufficient permission enforcement
Risk Level: MediumVulnerable Code
python REASON_DIR = os.path.expanduser("~/.openclaw/workspace/memory/reason") def ensure_dir(): os.makedirs(REASON_DIR, exist_ok=True)python # Save analysis analysis_id = f"DECISION-{str(uuid.uuid4())[:6].upper()}" analysis = { "id": analysis_id, "decision": args.decision, "factors": args.factors, "created_at": datetime.now().isoformat() } decisions_file = os.path.join(REASON_DIR, "decisions.json") data = {"decisions": []} if os.path.exists(decisions_file): with open(decisions_file, 'r') as f: data = json.load(f) data['decisions'].append(analysis) ensure_dir() with open(decisions_file, 'w') as f: json.dump(data, f, indent=2)Technical Analysis
The script persistently records the complete value supplied through
--decisionand the associated--factorsvalue in a plaintext JSON file. Decision descriptions may contain private employment, financial, health, relationship, or other personal information.The storage directory is created without an explicit restrictive mode, and the file is opened without explicitly enforcing owner-only permissions. Consequently, the effective permissions depend on the process umask and any permissions already present on the directory or file. The script also does not validate the ownership or permissions of an existing storage location.
This implementation does not technically guarantee the privacy claim in
SKILL.mdthat personal decisions remain private. No encryption, opt-in retention, automatic expiration, or deletion mechanism is implemented.Attack Path
- A user invoke ...[truncated 1110 chars]
- Remediation
View remediation
Remediation Suggestions
- Create the storage directory with owner-only permissions such as mode
0700, and verify the permissions and ownership of existing directories before use. - Create the data file with mode
0600. Do not rely exclusively on the caller's umask. - Reject storage paths or files that are not owned by the current user.
- Make persistent retention opt-in and clearly notify users that their full input will be stored.
- Provide commands or documented procedures to inspect, delete, and disable retained records.
- Consider minimizing stored data, redacting sensitive text, or storing only an identifier unless the full decision text is necessary.
- If the threat model includes privileged local processes or compromised user accounts, use encryption backed by an appropriate operating-system credential store. File encryption alone does not protect data while the application is running.
- Create the storage directory with owner-only permissions such as mode
