Back to skill

Security audit

剪贴板历史

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent clipboard-history utility, but users should understand it can retain copied sensitive text locally when monitoring is enabled.

Install only if you are comfortable with a local clipboard history. Avoid enabling monitoring while copying passwords, API keys, private links, or confidential documents, and clear the history regularly because retained records are plaintext.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:26
Finding

Plaintext Capture and Storage of Sensitive Clipboard Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 26–61 and 125–140
Vulnerability Type: Plaintext storage and indiscriminate collection of potentially sensitive clipboard data
Risk Level: Medium

The skill stores up to 50 clipboard records in a local plaintext JSON file. Its optional monitoring mode polls the system clipboard and automatically saves new content without filtering sensitive values.

Vulnerable Code

python
CLIPBOARD_FILE = os.path.join(os.path.dirname(__file__), "clipboard_history.json")

class ClipboardHistory:
    MAX_ITEMS = 50
    
    def __init__(self):
        os.makedirs(os.path.dirname(CLIPBOARD_FILE), exist_ok=True)
        self.history = self._load()
    
    def _load(self):
        if os.path.exists(CLIPBOARD_FILE):
            try:
                with open(CLIPBOARD_FILE, encoding="utf-8") as f:
                    return json.load(f)
            except (json.JSONDecodeError, ValueError):
                return []
        return []
    
    def _save(self):
        with open(CLIPBOARD_FILE, "w", encoding="utf-8") as f:
            json.dump(self.history, f, ensure_ascii=False, indent=2)
    
    def save(self, text: str) -> dict:
        """Save a clipboard record with deduplication."""
        if not text or not text.strip():
            return {"saved": False, "reason": "empty"}
        
        if self.history and self.history[0]["text"] == text.strip()[:200]:
            return {"saved": False, "reason": "duplicate"}
        
        entry = {
            "text": text.strip()[:200],
            "length": len(text.strip()),
            "time": datetime.now().isoformat(),
            "timestamp": time.time()
        }
        self.history.insert(0, entry)
        if len(self.history) > self.MAX_ITEMS:
            self.history = self.history[:self.MAX_ITEMS]
        self._save()
python
def auto_watch(interval: float = 1.0):
    """Poll the clipboard and automatically save new content."""
    ch =
...[truncated 3104 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require explicit, informed opt-in before starting clipboard monitoring and clearly warn that credentials and other sensitive values may be retained.
  2. Store records in an operating-system-specific, per-user application-data directory rather than beside the skill.
  3. Create storage with owner-only permissions and verify permissions before reading or writing it.
  4. Encrypt clipboard records at rest using an OS-backed credential or key-protection facility; do not store the encryption key beside the data.
  5. Add configurable filters for common secrets, including passwords, API keys, bearer tokens, private keys, authentication cookies, and connection strings.
  6. Support application-level exclusions so clipboard values copied from password managers, terminals, and other sensitive applications are not recorded.
  7. Remove clipboard previews from console output, or make previews disabled by default with automatic redaction.
  8. Implement short, configurable expiration periods in addition to the 50-item limit.
  9. Provide clear controls to inspect, selectively delete, and clear retained records.
  10. Document the storage location, retention policy, security limitations, and cleanup procedure.
  11. Avoid silently swallowing all monitoring exceptions; report sanitized errors so permission and storage failures can be identified without revealing clipboard content.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill persistently stores clipboard contents to a local JSON file and includes an automatic monitoring mode, but the documentation does not clearly warn users that copied secrets such as passwords, tokens, personal data, or confidential text may be retained on disk. This is dangerous because clipboard data is often sensitive, and silent persistence increases the chance of later exposure to other local users, malware, backups, or accidental disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Natural-language content in the description and usage guidance is primarily Chinese, which can impose a language preference on users without opt-in. The policy allows locale constraints when clearly documented and justified, but this file does not explain that the skill is intentionally Chinese-language or provide alternatives.

Content

No source excerpt is available for this finding.