T09 · Insecure Skill Coding Practices
- Location
scripts/clipboard_watcher.py:183- Finding
Indiscriminate Clipboard Capture and Plaintext Persistence
- Content
View full analysis
Vulnerability Details
File Location:
scripts/clipboard_watcher.py, lines 183-238 and 245-259
Vulnerability Type: Sensitive data exposure through insecure clipboard processing and plaintext storage
Risk Level: MediumVulnerable Code
python if not text or len(text.strip()) < 5: return None text = text.strip() output_dir = output_dir or DEFAULT_OUTPUT date_str = datetime.now().strftime("%Y-%m-%d_%H%M%S") out_path = Path(output_dir) / date_str out_path.mkdir(parents=True, exist_ok=True) results = {} summary = { "original": text[:200], "original_hash": hashlib.md5(text.encode()).hexdigest()[:8], "platforms": {}, "generated_at": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), }python (out_path / "summary.json").write_text( json.dumps(summary, ensure_ascii=False, indent=2), encoding="utf-8" )python text = get_clipboard_text() if not text: return None text_hash = hashlib.md5(text.encode()).hexdigest()[:8] if text_hash == last_hash: return None last_hash = text_hash return process_content(text)Technical Analysis
The continuous watcher processes every changed clipboard string containing at least five characters. It does not verify that the value is an article, supported URL, or other intended content type. It also does not detect likely credentials, access tokens, private keys, passwords, or other sensitive values.
The first 200 characters of the clipboard value are copied directly into
summary.json. Additional source fragments are incorporated into generated Markdown files. These files are stored in timestamped directories beneath the configured output directory, which defaults to the user's desktop.No restrictive file permissions, encryption, retention policy, deletion mechanism, or user confirmation is applied. Desktop directories may also be synchronized automatically by cloud-storage software, ...[truncated 1385 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit user confirmation before processing or storing clipboard content.
- Validate that the input matches an intended content type, such as an HTTP or HTTPS URL or sufficiently long article text.
- Reject or redact likely secrets, including private keys, bearer tokens, API keys, authentication cookies, and password-manager output.
- Do not retain the original clipboard value by default. Make source retention an explicit opt-in setting.
- Store only the minimum source fragment required for the requested transformation.
- Create output files with permissions restricted to the current user.
- Offer configurable retention and automatic deletion of old generated directories.
- Warn users that desktop folders may be synchronized to external services.
- Add a pause or exclusion mechanism so users can temporarily disable monitoring before copying sensitive data.
- Consider processing a user-selected clipboard item only once rather than continuously monitoring all clipboard changes.
