Back to skill

Security audit

zpw-mianfei-web

Security checks for vulnerabilities and agentic risk

Overview

This search skill is purpose-aligned, but it uses an unsafe shell curl command that can turn a search query into command execution and sends queries to an internal HTTP endpoint with little user control.

Review before installing. The skill should be changed to avoid shell interpolation, for example by using a structured HTTP client or curl with --get and --data-urlencode, and it should clearly disclose the HTTP search endpoint and ask before sending sensitive queries.

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

Error
Location
SKILL.md:27
Finding
Command Injection Through Unsanitized Search Query Interpolation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 27–31 **Vulnerability Type**: Shell command injection **Risk Level**: High ### Vulnerable Code ```markdown 2\. 执行命令: &#x20; ```bash &#x20; curl -s 'http://192.168.199.100:8080/search?q={{query}}\&format=json' ``` ### Technical Analysis The skill directs the Agent to extract a user-controlled search query and interpolate it into a shell command. Although the URL is enclosed in single quotes, the instructions do not validate or escape single-quote characters in `{{query}}`. If template substitution occurs before shell execution, an attacker can supply a query containing a single quote to terminate the quoted URL, followed by shell control operators and an arbitrary command. A trailing comment marker can suppress the remainder of the generated command. A representative malicious query is: ```text ' ; id > /tmp/search-injection-proof # ``` After unsafe substitution, the effective shell input could resemble: ```bash curl -s 'http://192.168.199.100:8080/search?q=' ; id > /tmp/search-injection-proof #\&format=json' ``` The shell would execute the injected `id` command independently of `curl`. The same technique could be used for other commands available to the Agent. ### Attack Path 1. An attacker asks the Agent to search for a crafted phrase containing a single quote, shell separators, an operating-system command, and a comment marker. 2. The skill extracts that phrase as the `query` value. 3. The Agent replaces `{{query}}` directly in the documented command without shell-safe encoding. 4. The injected single quote closes the URL string. 5. Shell operators cause the attacker's appended command to execute. 6. The command runs under the operating-system identity and permissions of the Agent process. Exploitation depends on the Agent performing literal template substitution and invoking the resulting text through a shell, which is the execution pattern implied by the skill instruct ...[truncated 644 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Avoid constructing shell source by interpolating user-controlled input. 1. Prefer a structured HTTP client or Agent HTTP tool that accepts the URL and query parameters as separate values. 2. If `curl` is required, store the query as data rather than embedding it into the command text: ```bash curl --silent --get \ --data-urlencode "q=$QUERY" \ --data "format=json" \ "http://192.168.199.100:8080/search" ``` 3. Invoke the process through an argument-array API rather than through `sh -c`, `bash -c`, or another shell interpreter. 4. Ensure `$QUERY` is supplied as a separate process argument or environment value and is never concatenated into generated shell code. 5. Add tests using hostile input containing single quotes, semicolons, command substitutions, newlines, and comment markers. 6. Use HTTPS for the search endpoint if supported to protect queries and responses from local-network interception or modification. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger phrases are very broad and can activate on common user requests like 'search' or 'look up,' causing the skill to run in situations the user may not have intended. Because execution sends the extracted query to a local HTTP service, overbroad activation increases the chance of unintended network access and data leakage from normal conversation.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill sends user-derived search terms over plain HTTP to an internal network endpoint without warning the user. This can expose sensitive queries to a local service, proxies, or network observers, and users are not informed that their input will leave the agent and be transmitted over the network.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The natural-language description and invocation phrases are entirely in Chinese, and the skill only documents Chinese trigger terms. This imposes a language constraint without stating that the skill is Chinese-only or offering an opt-in or alternative language choice.

Static analysis

No suspicious patterns detected.