Back to skill

Security audit

Clipboard Stash Demo

Security checks for vulnerabilities and agentic risk

Overview

This skill is a simple local snippet stash whose persistence and plaintext storage are disclosed and aligned with its purpose.

Install only if you are comfortable with snippets being stored unencrypted under ~/.cache/clipboard-stash/stash.tsv. Do not use it for secrets or sensitive personal data, and treat clear-all as permanent unless you have your own backup.

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

Note
Location
SKILL.md:31
Finding

Plaintext Stash Created Without Restrictive File Permissions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 31–35
Vulnerability Type: Plaintext data exposure caused by insecure filesystem permissions
Risk Level: Low

Vulnerable Code

bash
mkdir -p ~/.cache/clipboard-stash
slug="$1"; shift; content="$*"
printf '%s\t%s\t%s\n' "$slug" "$(date -Is)" "${content//$'\n'/\\n}" \
  >> ~/.cache/clipboard-stash/stash.tsv

Technical Analysis

The command stores user-provided clipboard content persistently in the plaintext file ~/.cache/clipboard-stash/stash.tsv. Neither the containing directory nor the file is assigned an explicit owner-only permission mode. Their permissions therefore depend on the invoking process's ambient umask.

With a commonly used 022 umask, the directory may be created with mode 0755 and the stash file with mode 0644. On a multi-user system, this can allow other local users to read saved snippets. Although the documentation advises users not to store secrets, that warning does not enforce confidentiality and ordinary notes may still contain private or sensitive information.

Attack Path

  1. A user invokes the save command and supplies a text snippet.
  2. The command creates ~/.cache/clipboard-stash and stash.tsv under the user's current umask.
  3. If the resulting directory traversal and file read permissions permit access, another local account reads ~/.cache/clipboard-stash/stash.tsv.
  4. The local account obtains stored slugs, timestamps, and clipboard content.

Exploitation requires local access under another account and filesystem permissions that allow traversal of the user's home directory and stash path.

Impact Assessment

The issue can disclose all entries stored in the stash, including their slugs, timestamps, and plaintext content. It does not grant code execution, elevated privileges, or remote access. The exposure is limited to local principals that can traverse the relevant directories and rea ...[truncated 11 chars]

Remediation
View remediation

Remediation Suggestions

Enforce owner-only permissions independently of the caller's environment:

bash
umask 077
mkdir -p -m 700 ~/.cache/clipboard-stash
touch ~/.cache/clipboard-stash/stash.tsv
chmod 600 ~/.cache/clipboard-stash/stash.tsv

slug="$1"; shift; content="$*"
printf '%s\t%s\t%s\n' "$slug" "$(date -Is)" "${content//$'\n'/\\n}" \
  >> ~/.cache/clipboard-stash/stash.tsv

Additionally:

  • Verify and repair permissions on pre-existing directories and stash files.
  • Retain the warning that secrets must not be stored in the stash.
  • Consider refusing to operate if the file is not owned by the current user or is a symbolic link.
  • Document that the data is persistent and unencrypted at rest.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README explicitly advertises persistent storage of clipboard-like content in a local backing file but does not warn that pasted notes may contain secrets, personal data, or other sensitive material that will remain on disk. In an agent context, users may assume this behaves like transient scratch memory, so the undocumented retention increases the chance of inadvertent sensitive-data exposure to other local processes, users, backups, or future sessions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

This skill persists user-provided text to a local plaintext file under ~/.cache, causing data to survive the immediate session and potentially be recalled or exposed later. While persistence is part of the intended functionality, it creates confidentiality and retention risk, especially if users accidentally stash sensitive content or if other local processes/users can read the file.

Content

Scanner excerpt · SKILL.md (reported line 34)May include surrounding context.

Save a snippet

bash
mkdir -p ~/.cache/clipboard-stash
slug="$1"; shift; content="$*"
printf '%s\t%s\t%s\n' "$slug" "$(date -Is)" "${content//$'\n'/\\n}" \
  >> ~/.cache/clipboard-stash/stash.tsv

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill exposes a one-line command that irreversibly truncates the entire stash file with no confirmation, backup, or warning at the point of use. In an agent setting, a user asking to clear one item or a misinterpreted instruction could result in permanent loss of all stored snippets.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.