Back to skill

Security audit

claude-code-skill-2

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent, but it recommends running an external coding agent with permission checks bypassed and broad project access, which needs careful review before use.

Install only if you intentionally want a skill that delegates coding work to Claude Code. Before following its templates, remove `--permission-mode bypassPermissions` by default, use the smallest explicit project path instead of `$(pwd)`, run reviews in read-only mode where possible, and inspect diffs before accepting any file changes.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:59
Finding

Claude CLI Invocations Disable Permission Enforcement

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 59-87
Vulnerability Type: Least-privilege violation through unrestricted agent permissions
Risk Level: High

Vulnerable Code

bash
claude -p "审查这个文件,找出 bug、安全问题、性能问题" --print --model deepseek-v4-flash --permission-mode bypassPermissions
bash
claude -p "在项目中修改xxx,要求..." --print --add-dir "D:\Qt program\MST-Visualizer" --permission-mode bypassPermissions
bash
claude -p "修改xxx" --print --add-dir "$(pwd)" --permission-mode bypassPermissions --model deepseek-v4-flash

The accompanying instructions state that tool-enabled operation permits the delegated agent to use file-reading, file-editing, and shell capabilities directly.

Technical Analysis

The documented command templates use --permission-mode bypassPermissions, disabling the normal approval boundary for Claude CLI tool operations. This setting is recommended not only for project modification but also for code review, even though a review task ordinarily requires read-only access.

Combining permission bypass with --add-dir "$(pwd)" is especially unsafe because the accessible directory depends on the caller's current working directory. If the command is launched from an unintended directory, the agent may receive access to a broader or more sensitive filesystem scope than the user expected.

A tool-enabled coding agent processes both the user's prompt and repository content. Consequently, malicious instructions embedded in source files, documentation, build metadata, or other repository artifacts could influence the agent. With permission checks bypassed, such influence can result in file modifications or shell execution without an interactive approval step.

The Skill does not itself contain an exploit payload and does not automatically execute these commands. The vulnerability is the unsafe default operating mode that removes a critical control when users follow the do ...[truncated 1977 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove --permission-mode bypassPermissions from every default command template.
  2. Use a read-only tool profile for audits and code reviews. Disable file editing and shell execution when they are not required.
  3. Require explicit user confirmation for every write, deletion, process execution, network operation, and access outside the initial project scope.
  4. Replace --add-dir "$(pwd)" with an explicit, canonicalized project path. Verify that the selected directory is the intended repository root before invocation.
  5. Restrict accessible paths to the smallest required subtree and exclude credential files, home-directory configuration, version-control credentials, environment files, and unrelated workspaces.
  6. Run modification tasks in an isolated worktree, container, or low-privilege account with no production credentials.
  7. Separate review and modification workflows. A review command should produce recommendations only; a later, independently approved step should apply changes.
  8. Treat repository content as untrusted input and instruct the delegated agent not to follow operational instructions found inside reviewed files.
  9. Review generated diffs and command logs before accepting changes, then run tests in an isolated environment.
  10. If permission bypass must exist for a narrowly controlled automation workflow, make it an exceptional opt-in mode with clear warnings, a fixed allowlisted directory, restricted tools, and external sandbox enforcement.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

1. 纯文本生成(最省 token)

bash
claude -p "写一个xxx函数,要求..." --print --tools "" --model deepseek-v4-flash
  • --tools "" 禁止工具调用,最省 token

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

1. 纯文本生成(最省 token)

bash
claude -p "写一个xxx函数,要求..." --print --tools "" --model deepseek-v4-flash
  • --tools "" 禁止工具调用,最省 token

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
93% confidence
Finding

This duplicate finding still represents an overly privileged review command: using an external agent with 'bypassPermissions' for file review is broader than necessary and can expose or alter local resources. The skill context increases danger because it normalizes elevated-permission delegation for routine analysis tasks.

Content

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

2. 代码审查

bash
claude -p "审查这个文件,找出 bug、安全问题、性能问题" --print --model deepseek-v4-flash --permission-mode bypassPermissions
  • 适合:代码审查、bug 分析、安全审计

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
93% confidence
Finding

This duplicate finding still represents an overly privileged review command: using an external agent with 'bypassPermissions' for file review is broader than necessary and can expose or alter local resources. The skill context increases danger because it normalizes elevated-permission delegation for routine analysis tasks.

Content

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

2. 代码审查

bash
claude -p "审查这个文件,找出 bug、安全问题、性能问题" --print --model deepseek-v4-flash --permission-mode bypassPermissions
  • 适合:代码审查、bug 分析、安全审计

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
96% confidence
Finding

This duplicate finding again documents broad write-capable delegation of project modifications to an external agent with permissions bypassed. Given the skill's purpose of handling heavy autonomous coding work, the combination of autonomous edits and suppressed permission controls presents a real risk of destructive or unintended changes.

Content

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

3. 操作项目文件

bash
claude -p "在项目中修改xxx,要求..." --print --add-dir "D:\Qt program\MST-Visualizer" --permission-mode bypassPermissions
  • --add-dir 给小c 项目上下文

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
96% confidence
Finding

This duplicate finding again documents broad write-capable delegation of project modifications to an external agent with permissions bypassed. Given the skill's purpose of handling heavy autonomous coding work, the combination of autonomous edits and suppressed permission controls presents a real risk of destructive or unintended changes.

Content

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

3. 操作项目文件

bash
claude -p "在项目中修改xxx,要求..." --print --add-dir "D:\Qt program\MST-Visualizer" --permission-mode bypassPermissions
  • --add-dir 给小c 项目上下文

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

4. 复杂任务(深度思考)

bash
claude -p "设计xxx的架构方案,考虑..." --print --model deepseek-v4-pro
  • 模型:pro(值得为架构决策多花 token)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

4. 复杂任务(深度思考)

bash
claude -p "设计xxx的架构方案,考虑..." --print --model deepseek-v4-pro
  • 模型:pro(值得为架构决策多花 token)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
97% confidence
Finding

This command grants an external agent access to the entire current working directory via '--add-dir "$(pwd)"' and disables permission checks with 'bypassPermissions'. That greatly enlarges the blast radius: if run from the wrong directory or with an unsafe prompt, the agent could inspect or alter unrelated files across a large project or workspace.

Content

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

5. 带工作目录(当前项目)

bash
claude -p "修改xxx" --print --add-dir "$(pwd)" --permission-mode bypassPermissions --model deepseek-v4-flash
  • 适合:在当前工作目录的项目中做修改

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill name and description are written entirely in Chinese, and the operational guidance throughout the file assumes Chinese prompts and interaction style. There is no indication that users may choose another language or that the locale restriction is intentional for a region-specific use case.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section explicitly instructs use of '--permission-mode bypassPermissions' together with project directory access for direct file modification, but it does not include guardrails about destructive edits, scope limitation, backups, or review before execution. Because the skill is designed to delegate heavy coding tasks to an independent agent, this omission materially increases the risk of unintended mass changes, data loss, or malicious prompt-driven modification of project files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documented workflow says to execute an external agent via shell and then act on its output, but it does not clearly warn that the child agent may autonomously read, edit, or invoke commands with system impact depending on flags. In a skill whose core purpose is orchestrating another CLI agent, the lack of explicit operational risk disclosure makes unsafe invocation more likely.

Content

No source excerpt is available for this finding.