Back to skill

Security audit

Agentsmd Creator

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a repository documentation generator, but it can silently replace an existing CLAUDE.md file with a symlink and changes more files than its headline output suggests.

Install only if you are comfortable with a documentation skill reading the repository and writing project guidance files. Before running it, check whether CLAUDE.md already exists and require the agent to preserve it instead of using ln -sf or replacing it automatically.

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:134
Finding

Forced Replacement of an Existing CLAUDE.md File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 134–138
Vulnerability Type: Unsafe forced symbolic-link creation
Risk Level: Medium

Vulnerable Code

markdown
- **CLAUDE.md compatibility** — After generating AGENTS.md, create a symbolic link in the repository root pointing to AGENTS.md:
  ```bash
  ln -sf AGENTS.md CLAUDE.md
text

### Technical Analysis

The Skill instructs the agent to execute `ln -sf AGENTS.md CLAUDE.md`. The `-f` option forces removal of an existing destination before creating the symbolic link. Consequently, an existing regular file or symbolic link named `CLAUDE.md` may be replaced without confirmation or backup.

Although the Skill requires preservation and merge handling for an existing `AGENTS.md`, it provides no equivalent safeguard for `CLAUDE.md`. A repository may maintain independent, user-authored agent instructions in that file. Unconditional replacement can therefore destroy those instructions and redirect subsequent Claude-compatible agents to the generated `AGENTS.md`.

This is an unsafe file-operation practice rather than privilege escalation: the command operates with the invoking agent's existing filesystem permissions and does not independently obtain additional privileges.

### Attack Path

1. A repository contains an existing, legitimate `CLAUDE.md` with project-specific instructions.
2. A user invokes this Skill to generate or update repository guidance.
3. The Skill generates or merges `AGENTS.md`.
4. It executes `ln -sf AGENTS.md CLAUDE.md`.
5. The existing `CLAUDE.md` entry is removed and replaced with a symbolic link.
6. The original content is lost unless separately recoverable through version control or backups.
7. Future Claude-compatible agents read generated `AGENTS.md` content through the link instead of the original instructions.

### Impact Assessment

The impact is limited to files writable by the invoking process. No additional system privileges are gained.

Within the targ
...[truncated 383 chars]
Remediation
View remediation

Remediation Suggestions

  1. Test for an existing destination before creating the link:
bash
if [ ! -e CLAUDE.md ] && [ ! -L CLAUDE.md ]; then
  ln -s AGENTS.md CLAUDE.md
else
  echo "CLAUDE.md already exists; preserving it."
fi
  1. If replacement is desired, require explicit user confirmation rather than using -f.
  2. Preserve an existing regular file by merging its relevant content or creating a timestamped backup before any replacement.
  3. Distinguish regular files, valid symbolic links, broken symbolic links, and directories, and handle each case safely.
  4. Avoid forced unlinking by default.
  5. If updates are necessary, use an atomic workflow: create a temporary link in the same directory, validate it, preserve the destination, and then rename it into place.
  6. Extend the Skill's existing merge-preservation policy to cover CLAUDE.md, not only AGENTS.md.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill metadata says the output is an AGENTS.md guide, but the body instructs the agent to also create or update docs/CODING_STYLE.md, docs/ARCHITECTURE.md, and later a root-level symlink. This mismatch reduces user awareness of write scope and can cause the agent to modify more of the repository than the user reasonably expected from the manifest alone.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description and instructions are entirely in Chinese and present the workflow as the default behavior without indicating that users may choose another language. Under the policy, a skill should not impose a specific language or locale unless it offers user opt-in or clearly documents a justified regional constraint.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger description includes general phrases like '用户需要创建 AGENTS.md', '生成项目 AI 指南', and '为仓库写 AI 上下文文件', which are broad intent descriptions rather than a narrow invocation boundary. The file does not provide exclusion conditions or negative examples, so the skill may be invoked for loosely related documentation requests.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest emphasizes a single <=200-line AGENTS.md output, but the documented workflow performs multi-file writes as normal behavior. That discrepancy can mislead users and higher-level orchestration systems into approving a skill with broader filesystem effects than advertised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill directs the agent to create and merge-update repository files without first warning the user that project files will be modified. In agentic environments, silent write behavior can lead to unintended repository changes, overwritten documentation, or trust abuse when the user expected analysis only.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs force-updating a root-level CLAUDE.md symlink via ln -sf without any warning or confirmation. Force replacement can silently alter existing repository state and may overwrite a real CLAUDE.md path entry or change tool behavior unexpectedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown template is entirely written in Chinese and instructs authors to produce project documentation in that language, but it does not provide any opt-in, alternative language option, or justification for the locale restriction. The policy specifically flags language or locale constraints when they are imposed without user choice.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

Creating a root-level CLAUDE.md symlink is a separate repository-modifying capability beyond drafting project guidance content. While potentially convenient for compatibility, it is not obviously required to generate AGENTS.md and is not declared in the manifest purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations in natural-language content. This markdown file presents all instructions and standards exclusively in Chinese, with no indication that users may choose another language or that the locale restriction is intentionally scoped.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file contains primary instructional content in Chinese while also embedding English phrasing as part of the examples, but it does not state whether the skill is intended to operate in Chinese, English, or both. Under the language/locale policy, forcing or assuming a language without user opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This document is primarily written in Chinese, but line L05 introduces the skill guidance in English without explaining language choice or offering a user-selectable locale. The policy explicitly calls for flagging language or locale constraints when a skill forces a specific language without opt-in.

Content

No source excerpt is available for this finding.