T09 · Insecure Skill Coding Practices
- Location
scripts/submit_score.py:115- Finding
Preview Payload Containing Sensitive Host Data Persists in a Temporary File
- Content
View full analysis
None: path.parent.mkdir(parents=True, exist_ok=True) path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8") def resolve_output_path(raw_output: str, preview_only: bool) -> Path | None: if raw_output: return Path(raw_output).expanduser().resolve() if not preview_only: return None handle = tempfile.NamedTemporaryFile( prefix="clawlock-rank-preview-", suffix=".json", delete=False, ) handle.close() return Path(handle.name).resolve() ``` ### Technical Analysis When preview mode is used without an explicit output path, the Skill creates a temporary JSON file with `delete=False`. The sanitized payload is subsequently written to this file, but no cleanup mechanism removes it after preview, upload, cancellation, failure, or process termination. The retained payload includes the raw `device_fingerprint`, security score, adapter details, timestamp, evidence hash, and finding titles. Although `NamedTemporaryFile` normally creates the file with restrictive permissions, the file remains accessible to the same account and may be collected by backups, diagnostics, support bundles, or a later process that compromises the user account. This network-independent persistence is not required once the preview-and-upload workflow has completed. ### Attack Path 1. A user runs `submit_score.py --preview-only`. 2. The Skill creates a file such as `/tmp/clawlock-rank-preview-*.json`. 3. The sanitized payload, including the raw device fingerprint and security finding titles, is written to that file. 4. The user cancels the upload, completes it, or abandons the workflow. 5. Because no cleanup routine runs, the file remains on disk. ...[truncated 849 chars]- Remediation
View remediation
