Back to skill

Security audit

代码

Security checks for vulnerabilities and agentic risk

Overview

This code-explanation skill should go to Review because it requests command execution and file-writing authority while its instructions broaden into automation, API use, and privileged troubleshooting without clear controls.

Install only if you are comfortable granting this skill more authority than code explanation normally requires. Use it in a restricted workspace, avoid administrator privileges, do not provide secrets or private repositories unless necessary, and require review before any command execution, file write, API call, batch processing, or export.

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

Warning
Location
SKILL.md:25
Finding

Excessive Tool Permissions Violate Least Privilege

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 25–30; supporting declarations at lines 214–216 and privilege guidance at line 228
Vulnerability Type: Excessive command-execution and file-write capabilities
Risk Level: Medium

Vulnerable Code

yaml
tools:
- read
- exec
- write
- glob
- grep

Technical Analysis

The skill's stated purpose is to explain source code through diagrams and analogies. That function can ordinarily be completed using user-supplied content or narrowly scoped, read-only access. Nevertheless, the manifest grants general exec and write capabilities alongside read and search tools.

The document also claims command-execution and file-writing functionality at lines 214–216 and recommends elevated execution when permissions are insufficient at line 228. No enforceable command allowlist, workspace path restriction, sandbox policy, privilege boundary, or explicit user-confirmation requirement is defined.

Because this is a documentation-only skill, the reviewed package does not itself contain an executable payload. Exploitation therefore depends on an Agent honoring these declared capabilities and allowing untrusted input to influence tool calls.

Attack Path

  1. A user supplies attacker-controlled source code, repository content, filenames, or embedded instructions for explanation.
  2. The skill-enabled Agent processes that untrusted content while possessing exec and write permissions.
  3. Crafted content persuades or causes the Agent to invoke a command or modify a file instead of limiting itself to code explanation.
  4. The command executes or the file is changed with the Agent process's current privileges.
  5. If the operator follows the elevated-permission guidance, the resulting effect may extend beyond the user workspace and affect privileged system resources.

Impact Assessment

Successful exploitation could permit command execution and file m ...[truncated 583 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove exec and write from the declared tools because they are not necessary for code explanation.
  2. Retain only narrowly scoped read and search capabilities, restricted to the user-approved project directory.
  3. Remove guidance recommending execution with administrator or root privileges.
  4. If code execution is genuinely required, use an isolated sandbox with:
    • A fixed command allowlist.
    • No network access by default.
    • Workspace-only filesystem access.
    • Read-only mounts wherever possible.
    • CPU, memory, process, and execution-time limits.
    • A non-privileged disposable operating-system account.
  5. Require explicit user confirmation before every command execution or file modification, displaying the exact command and affected paths.
  6. Treat source files and repository documentation as untrusted data and prohibit instructions embedded in them from authorizing tool calls.
  7. Align the documented feature set with actual behavior so a code-explanation skill does not advertise unrelated file-writing, API-integration, or system-command capabilities.
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 (7)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest grants exec, write, and other powerful capabilities even though explaining code primarily requires read access. In a skill with confused and overbroad documentation, unjustified command execution materially raises the risk of filesystem changes, arbitrary command execution, data exfiltration, or unintended interaction with the environment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a code-explanation tool, but the documentation expands it into code generation, review, testing, deployment, and automation workflows. This scope drift can cause an agent or user to invoke broader behaviors than expected, weakening least-privilege assumptions and making risky tool use seem legitimate.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The declared output format describes grading, compliance, and improvement reports instead of code explanations. This mismatch can mislead orchestration layers or users into trusting the skill for evaluative/security decisions it was not clearly designed for, increasing the chance of inappropriate automation or overcollection of code context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation claims code generation, batch repository processing, and export/reporting capabilities that materially exceed a simple explanation skill. In context, this increases the likelihood that the agent will process large codebases, generate artifacts, or handle more sensitive data than the user expects from the skill name and summary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises file writing, API usage, and command execution without clear user-facing warnings about side effects. For a skill branded as explanation-focused, this can create a false expectation of passive analysis while enabling active changes or network interactions that affect system integrity and confidentiality.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation advertises API integration and external service calling unrelated to code explanation. This broadens the trust boundary beyond local analysis and can expose code or metadata to third-party services without clear necessity, especially dangerous when paired with ambiguous scope and automation claims.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The display name, summary, and description are presented entirely in Chinese, and the document does not indicate that users may choose another language. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale limitation is explicitly justified.

Content

No source excerpt is available for this finding.