Back to skill

Security audit

代码解释工具免费版

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a code-explanation skill, but it asks for command execution and file-writing powers that are broader than its stated read-and-explain purpose.

Review this before installing. It is not clearly malicious, but for a code explanation helper you should prefer a read-only version or run it only in a sandboxed workspace. Do not grant write or broad command execution unless you are comfortable with an agent being able to modify files or run local commands while handling code snippets.

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

Excessive Command Execution and File-Write Permissions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 32–36
Vulnerability Type: Violation of least privilege
Risk Level: Medium

Vulnerable Configuration

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

Technical Analysis

The skill declares exec and write access even though its stated purpose is to explain code from a single file. Reading and explaining source code requires file-read capability, but it does not inherently require arbitrary command execution or file modification.

The document later states that some functionality uses exec to read files, despite the dedicated read tool already being available. No feature described in the skill requires writing files. These permissions therefore exceed the minimum privileges necessary for the declared functionality.

This creates a dangerous capability boundary: if untrusted source code, a user request, or another contextual instruction influences the agent's behavior, the unnecessarily available tools could be invoked to execute commands or alter files. The audited skill does not itself contain an instruction that actively abuses these tools, so exploitation depends on the hosting agent granting the declared permissions and being induced to misuse them.

The pre-scan warning concerning transmission of sensitive information was also reviewed. The optional callback_url field is documented in an input-format table, but no instruction or implementation uses it to transmit data. No confirmed network exfiltration behavior was found.

Attack Path

  1. The skill is loaded by an agent platform that grants all tools declared in its front matter.
  2. The agent receives attacker-controlled source code or a crafted explanation request containing adversarial instructions.
  3. The adversarial content attempts to persuade or confuse the agent into invoking exec or write.
  4. Because those tools are unnecessarily available, the ag ...[truncated 865 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove exec and write from the declared tools:
    yaml
    tools:
      - read
    
  2. Retain glob or grep only if file discovery or content searching is genuinely required; for strict single-file explanation, prefer read-only access to the explicitly selected file.
  3. Replace every suggested use of exec for reading files with the dedicated read tool.
  4. Explicitly instruct the agent to treat analyzed source code and comments as untrusted data, not as executable agent instructions.
  5. If future functionality genuinely requires command execution, place it in a separate opt-in skill with command allowlisting, explicit user confirmation, workspace confinement, timeouts, output limits, and network isolation.
  6. Do not add callback transmission unless it is essential. If added later, require explicit consent, restrict destination schemes and hosts, block private and link-local addresses, and prevent source code, credentials, and environment data from being sent.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill enables read, write, exec, glob, and grep tools but does not warn users that it can inspect, modify, and execute against the local environment. In a code-explanation context, these permissions are unexpectedly powerful and could expose secrets, alter files, or run commands beyond the user's expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill is presented as a code-explanation helper, but its documented interface includes a callback URL and generic create/query/export style operations that are not necessary for simple local explanation. This scope expansion can justify unexpected network egress or broader data handling, increasing the risk that source code or prompts are transmitted externally without clear user understanding.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The free edition is described as focused on single-file explanation, but later documentation broadens behavior to generic operational capabilities such as create/query/export and 'execute core function.' Ambiguous capability expansion is dangerous because it can conceal higher-risk actions behind an apparently harmless documentation label.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The example invocations use broad phrases like "请解释这段代码" and "这段代码在做什么?", which are common conversational requests rather than narrowly scoped trigger phrases. The document does not provide exclusion conditions or boundaries for when the skill should or should not activate, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The configuration example sets language: zh-CN as the default explanation language, which can impose a specific locale without indicating that users may choose another language. The file does not justify this as a region-specific tool or present it as an opt-in preference.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file claims all code analysis is completed locally, yet elsewhere it defines callback URLs and network error handling. This contradiction can mislead users into exposing proprietary code under the false assumption that no data leaves the local environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents its guidance and examples in Chinese only, beginning with the title and introductory text. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

Lines stating that all code analysis is completed locally and that no extra API key is needed imply a primarily local, self-contained explanation workflow. The later error handling section discusses network errors and instructs users to test connectivity with ping, which suggests networked behavior beyond the locally framed explanation experience.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.