Back to skill

Security audit

通信仿真文档写作

Security checks for vulnerabilities and agentic risk

Overview

This documentation skill is mostly aligned with its purpose, but it also tells the agent to persist failure notes and propose changes to its own instructions.

Review before installing. The documentation-writing behavior is reasonable, but remove or disable the self-evolution section unless you explicitly want the agent to create diary files and propose edits to the skill's own instructions. Also clarify whether outputs should be .txt or Markdown and pin any npx-based install workflow you choose to use.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:45
Finding

Persistent Agent Memory Poisoning Through Self-Evolving Skill Instructions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 45–53
Vulnerability Type: Persistent storage of execution-derived instructions and modification of the skill’s governing rules
Risk Level: High

Vulnerable Code

markdown
## Self-Evolution Mechanism

After each execution of this Skill:

1. Evaluate whether the output achieved the intended goal: **pass / fail**.
2. If it fails, reflect on the cause of failure and append a “failure case + improvement suggestion” to `diary/YYYY-MM-DD.md`.
3. If a certain improvement suggestion is repeatedly mentioned in the most recent three executions, refine it into a formal rule and submit a PR to modify this `SKILL.md`.

Technical Analysis

The skill directs the agent to persist failure analyses and improvement suggestions in diary/YYYY-MM-DD.md. It then instructs the agent to promote repeatedly stored suggestions into formal rules and submit a pull request modifying SKILL.md.

This creates an unsafe path from task-controlled content to persistent, authoritative agent instructions. Simulation source code, papers, documentation, or user prompts processed by the skill may contain adversarial text designed to influence the generated failure analysis. If such content is incorporated into an improvement suggestion, it can persist beyond the current execution.

The repetition check does not establish trustworthiness. An attacker able to invoke the skill repeatedly, or influence three executions, could cause the same malicious suggestion to recur and qualify for promotion. Turning that suggestion into a rule in SKILL.md would make it part of the instructions loaded during future sessions.

This behavior is unrelated to the skill’s legitimate documentation-writing purpose and crosses a trust boundary between untrusted task inputs, persistent state, and governing instructions.

Attack Path

  1. An attacker supplies a user prompt, paper, source file, or other artifact containing instructions cr ...[truncated 1825 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the entire Self-Evolution Mechanism section from SKILL.md.
  2. Do not write task-derived reflections, recommendations, or user-controlled content into the skill directory or any state automatically loaded by future agent sessions.
  3. If quality telemetry is required, store it in a separate, access-controlled system as structured, non-executable data.
  4. Treat all prompts, papers, source files, logs, and generated reflections as untrusted input. Never promote their contents automatically into agent instructions.
  5. Require explicit human initiation and security review for every change to SKILL.md; the agent should not autonomously submit instruction-changing pull requests.
  6. Protect the skill directory using least-privilege permissions and make installed skill instructions read-only during normal execution.
  7. If feedback files must be retained, sanitize their contents, prevent them from being loaded as instructions, record provenance, and enforce retention limits.
  8. Add repository controls requiring designated reviewer approval for changes to skill instructions, particularly changes that introduce tool calls, persistence, external communication, or expanded filesystem access.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (20)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
three executions, refine it into a formal rule and submit a PR to modify this `SKILL.md`.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says this skill is for producing Chinese plain-text documentation, specifically '.txt' simulation program documents. However, the README repeatedly states that the skill generates Markdown '.md' files by default and stores those Markdown outputs in the target folder. That is a direct semantic mismatch in the skill's claimed output format and behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description says the skill is for writing, reviewing, and improving Chinese communication-simulation documentation, which establishes a fixed language expectation. Because the README does not offer an alternative language option or explicit user opt-in, this is a natural-language locale policy concern under the language-choice rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README says the skill writes Chinese simulation-program documentation, and later examples reinforce that output should be in Chinese. This appears to enforce a specific language rather than letting the user choose, with no documented justification such as a region-specific compliance requirement.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 98)May include surrounding context.

macOS/Linux 用户级安装:

bash
mkdir -p ~/.claude/skills
cp -R /path/to/simulation-doc-writer ~/.claude/skills/simulation-doc-writer

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 98)May include surrounding context.

macOS/Linux 用户级安装:

bash
mkdir -p ~/.claude/skills
cp -R /path/to/simulation-doc-writer ~/.claude/skills/simulation-doc-writer

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 98)May include surrounding context.

macOS/Linux 用户级安装:

bash
mkdir -p ~/.claude/skills
cp -R /path/to/simulation-doc-writer ~/.claude/skills/simulation-doc-writer

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 105)May include surrounding context.

项目级安装:

bash
mkdir -p .claude/skills
cp -R /path/to/simulation-doc-writer .claude/skills/simulation-doc-writer

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction 'Draft in Chinese unless the user asks otherwise' imposes a default language choice rather than obtaining user opt-in. This can violate language/locale policy because it forces a specific language unless the user actively overrides it.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The self-evolution section grants the skill authority to write to diary/YYYY-MM-DD.md and submit a PR modifying SKILL.md, which expands behavior beyond documentation generation into persistent repository modification. This creates an unnecessary self-modification channel that could be abused to exfiltrate data, poison future runs, or silently alter agent behavior without explicit user authorization.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest presents a documentation-writing skill, but the instructions authorize creating diary files and modifying the skill via PRs, which is a capability mismatch. Hidden repository-write behavior is dangerous because users invoking a doc writer would not reasonably expect it to alter project metadata or persist internal reflections to the repo.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The display name, short description, and default prompt all specify Chinese-language behavior as a fixed requirement. This is a natural-language locale policy concern because the file does not indicate that the user can choose another language or explicitly opt in to Chinese output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The template explicitly instructs authors to produce a complete Chinese description document, which imposes a specific language requirement by default. This is a natural-language policy issue because it does not offer the user a language choice or indicate that Chinese is optional.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

L010 says the program description document must be generated as a plain-text .txt file and should not use .md unless the user explicitly asks for extra export. However, L014 instructs that generated code, Markdown documentation, and accompanying output files should be placed in the target folder, which conflicts with the earlier no-Markdown requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The checklist says the document should use a Chinese engineering-document style, which enforces a language/locale constraint. Because the file does not present this as an opt-in or clearly justified regional requirement, it violates the language-choice policy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructs appending to a diary file without any user-facing disclosure or confirmation, causing silent side effects outside the requested task. Even if the content is only failure analysis, undisclosed writes can leak sensitive context into repository history and violate user expectations about what the skill will modify.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest uses a natural-language invocation description, "Use $simulation-doc-writer to draft a Chinese communication simulation program specification," but does not define when this skill should or should not be selected beyond the broad drafting task. For a manifest file, the lack of explicit trigger constraints or negative examples can lead to unintended activation in adjacent documentation-writing contexts.

Content

No source excerpt is available for this finding.