Back to skill

Security audit

Crayfish Diary

Security checks for vulnerabilities and agentic risk

Overview

This diary skill is mostly a disclosed local note recorder, but it also ships a manual publish script that can push an entire local skill directory to GitHub without an allowlist or confirmation.

Install only if you are comfortable with diary entries being saved as persistent local Markdown files and summarized in daily README files. Use explicit start and stop phrases, avoid recording secrets, and review or remove scripts/publish.sh unless you intentionally need maintainer publishing tooling and have checked exactly what it would push.

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
scripts/publish.sh:7
Finding
Unrestricted Git Staging May Publish Unintended Sensitive Files## Vulnerability Details **File Location**: `scripts/publish.sh`, lines 7-54 **Vulnerability Type**: Unrestricted file staging and remote publication **Risk Level**: Medium ### Vulnerable Code ```bash SKILL_DIR="/Users/italks/WorkBuddy/Claw/.codebuddy/skills/crayfish-diary" REPO_URL="https://github.com/italks/crayfish-diary.git" if [ ! -d "$SKILL_DIR" ]; then exit 1 fi cd "$SKILL_DIR" if [ ! -d ".git" ]; then git init fi git add . if git diff --staged --quiet; then echo "No changes to commit" else git commit -m "Update diary skill" fi if ! git remote | grep -q "origin"; then git remote add origin "$REPO_URL" fi git branch -M main git push -u origin main ``` The original script includes informational output and a multiline commit message between these operations; they do not alter the vulnerable staging and publication behavior. ### Technical Analysis The publishing script changes into a hard-coded directory outside the installed artifact path and executes `git add .`. This recursively stages every eligible file beneath that directory rather than limiting publication to the intended release files. The audited project does not contain a `.gitignore`, although `PUBLISH.md` lists one as part of the expected package. Consequently, local configuration files, credentials, private notes, generated artifacts, or other unintended files placed beneath the target directory can be included in a commit. The subsequent unconditional `git push -u origin main` publishes the commit to the configured remote repository. The hard-coded path also means the script may operate on a different copy of the project than the copy from which the script is invoked. There is no validation of the repository root, staged file list, remote URL when an `origin` remote already exists, or sensitive-file patterns before publication. ### Attack Path 1. A sensitive or unintended file is created or alre ...[truncated 1563 chars]
Remediation
## Remediation Suggestions 1. Derive the repository directory from the script's own location instead of using an absolute user-specific path: ```bash SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" SKILL_DIR="$(cd -- "$SCRIPT_DIR/.." && pwd)" cd -- "$SKILL_DIR" ``` 2. Add a restrictive `.gitignore` covering secrets and generated files, including `.env`, private keys, credential files, archives, caches, and editor metadata. 3. Replace `git add .` with an explicit release allowlist: ```bash git add -- \ SKILL.md README.md README_CN.md PUBLISH.md clawhub.json \ scripts/create_diary.py scripts/publish.sh \ assets/crayfish_icon.svg .gitignore ``` 4. Reject sensitive files before committing by inspecting the staged file list and running a secret scanner such as Gitleaks or TruffleHog. 5. Display `git diff --cached --name-status` and require explicit operator confirmation before committing or pushing. 6. Validate that `git rev-parse --show-toplevel` equals the intended project directory and verify the exact `origin` URL even when that remote already exists. 7. If unintended sensitive data has already been pushed, rotate exposed credentials immediately and remove the material from repository history using an appropriate history-rewriting procedure.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (23)

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding
The description presents a simple recording skill, but the documented behavior adds persistent summary generation and broader content processing that are not fully disclosed in the top-level description. This mismatch can mislead users and reviewers about the amount of data retained and transformed, increasing privacy and consent risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The description presents a simple recording skill, but the documented behavior adds persistent summary generation and broader content processing that are not fully disclosed in the top-level description. This mismatch can mislead users and reviewers about the amount of data retained and transformed, increasing privacy and consent risk.

Vague Triggers

Medium
Confidence
97% confidence
Finding
The documented start trigger is a common natural-language phrase that could easily appear in ordinary conversation, increasing the chance of accidental skill activation. In a diary-recording skill, unintended activation can capture sensitive personal notes or surrounding conversation without the user meaning to start recording.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The feature description emphasizes convenience but does not clearly warn users that diary content will be saved as local Markdown files and additionally summarized into a daily README. That omission increases the risk that users disclose sensitive personal or work information without understanding the storage and aggregation behavior.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The documented trigger set includes generic English phrases such as "start recording" and "help me record," which are broad enough to be invoked unintentionally during normal conversation. In a diary skill that persists spoken content to local Markdown files and generates summaries, accidental activation can lead to unintended capture and storage of sensitive user information.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The feature description highlights convenience but does not prominently warn users that the skill writes persistent diary files and also auto-generates summary documents. This omission is risky because users may disclose sensitive personal or work information without realizing it will be stored on disk and duplicated in a daily index, increasing exposure.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrase “帮我记一下” is broad, conversational language that can plausibly occur in ordinary chat, increasing the chance the skill activates unintentionally. In a skill that persistently writes Markdown files and generates daily summaries, accidental activation can capture private user content and create records the user did not explicitly intend to store.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The English triggers “help me record,” “start recording,” “end recording,” and “finish recording” are highly generic and overlap with normal assistant interactions. Because this skill stores content persistently, ambiguous triggers raise the risk of unintended recording sessions or premature termination, leading to privacy issues and unexpected file creation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill describes file creation and writing behavior but does not declare any explicit tool scope or permission boundary. In an agent environment, undeclared write capabilities reduce transparency and policy enforcement, making it easier for a skill to persist data without clear authorization controls.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill is designed to create directories and write diary content automatically without clearly warning the user that the content will be stored persistently on disk. For a diary/memo skill, this is particularly sensitive because users may disclose personal, confidential, or regulated information.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger rules include broad intent-based conditions such as wanting to record information, which may cause the skill to activate when the user did not intend persistent storage. In this context, unintended invocation is risky because it results in filesystem writes and retention of potentially sensitive text.

Ssd 3

Medium
Confidence
95% confidence
Finding
The instruction to collect all subsequent conversation content until a stop phrase can capture unrelated, excessive, or highly sensitive information beyond the user's intended memo. In a diary context, broad transcript-style capture materially increases privacy exposure and the risk of over-retention.

Ssd 3

Medium
Confidence
93% confidence
Finding
Automatically reproducing excerpts of every entry in a daily README duplicates sensitive content and broadens its exposure surface. This makes private diary text easier to discover, index, or leak than if it were kept only in the original entry files.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
Using shell command execution for routine directory creation unnecessarily expands the attack surface. If workspace paths or related parameters are influenced by user input and not strictly sanitized, command execution can lead to command injection or unintended filesystem modifications.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger phrase 'help me record' is broad natural language that can easily appear in ordinary conversation, causing unintended activation of the diary skill. In a note-taking skill that captures user content, accidental invocation can lead to unintended recording of sensitive information or confusing workflow hijacking.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The phrase 'start recording' is highly ambiguous and commonly used in normal speech or in other app contexts, so it may activate this skill unexpectedly. Because this skill records free-form diary or memo content, accidental activation increases the risk of capturing unintended or sensitive data.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The phrase 'end recording' is generic and may be spoken in unrelated contexts, which can prematurely terminate an active session. This can cause integrity and usability issues by truncating user notes, and may also let nearby speech or unrelated instructions interfere with the skill's state.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The trigger 'finish recording' is too broad and overlaps with common conversational language, making unintended session termination plausible. In this skill's context, that can lead to incomplete notes, accidental saves, or disruption of the user's intended workflow.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The script hard-codes Chinese text in generated content, and similar fixed Chinese strings appear throughout the file, which means the skill always produces Chinese-language artifacts regardless of user preference. This is a natural-language locale policy concern because no opt-in, configuration, or justification for a Chinese-only mode is provided.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The script automatically configures a Git remote and pushes the entire skill directory to GitHub, which is functionality unrelated to the diary skill's stated purpose. This creates a data-exfiltration and unintended publication risk if sensitive notes, local configuration, or secrets are present in the repository, and the hardcoded remote increases the chance of accidental disclosure.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
The trigger section defines invocation phrases only in Chinese, which may impose a language-specific interaction requirement. The file does not indicate that users can choose another language for activation or that the Chinese-only constraint is intentional and justified.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The feature description instructs users to say the Chinese phrase "帮我记一下" to start recording, while the document itself is presented in English and does not clearly state that Chinese-only invocation is required or optional. This can constitute a language/locale policy issue because it implicitly privileges one language without explicit opt-in or clear justification.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The usage examples instruct the interaction flow entirely in Chinese, including required spoken phrases such as "帮我记一下" and "结束记录," while not indicating that users may choose another language in this variant of the skill. This can be a locale/language policy concern when a skill appears to require a specific language without explicit opt-in or justification.

Static analysis

No suspicious patterns detected.