Back to skill

Security audit

Search Strategy Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent search helper, but its URL handling can be abused to read local files or reach internal services, and its external data flows are under-disclosed.

Review this skill before installing if you may pass private URLs, internal hostnames, local file paths, or sensitive search terms. Avoid using --engine=multi with untrusted URLs, and assume queries or URLs may be sent to external search and scraping providers.

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
scripts/search-strategy.sh:167
Finding
Unrestricted URL Handling Enables Local File Disclosure and Server-Side Request Forgery<![CDATA[ ## Vulnerability Details **File Location**: `scripts/search-strategy.sh`, lines 65–67 and 167–173 **Vulnerability Type**: Unrestricted URL scheme and destination handling **Risk Level**: High ### Vulnerable Code User-supplied URL input is accepted without scheme or destination validation: ```bash url=*) URL="${1#url=}" shift ;; ``` When the `multi` engine is selected, that value is passed directly to `curl`: ```bash if [ -n "$URL" ]; then log_info "目標 URL: $URL" curl -s --compressed "$URL" 2>/dev/null | head -100 || { log_warn "直接存取失敗,嘗試 jina.ai 代理..." curl -s --compressed "https://r.jina.ai/http://$(echo "$URL" | sed -e 's|https://||' -e 's|http://||')" | head -200 } fi ``` ### Technical Analysis The script checks only whether `URL` is nonempty. It does not restrict the URL scheme, validate the destination host, resolve and inspect destination IP addresses, or prevent access to local and private resources. Quoting `"$URL"` prevents shell word splitting and shell metacharacter expansion, but it does not enforce a safe URL policy. Curl supports schemes other than HTTP and HTTPS, including `file://`. Consequently, a caller can cause the process to read files accessible to the operating-system account running the Skill. HTTP destinations are also unrestricted. The process can therefore send requests to loopback interfaces, private networks, link-local addresses, and potentially cloud instance metadata services. This constitutes server-side request forgery when an untrusted party can influence the URL passed to the Skill. Additionally, curl is not given an explicit `--` option terminator. A URL-like input beginning with `-` may be interpreted as a curl command-line option rather than a URL. ### Attack Path #### Local File Disclosure 1. An attacker influences a URL handled by the Agent or directly invokes the Skill with a crafted URL. 2. The attacker explicitly selects the `multi` engine, bypassing the d ...[truncated 1702 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Allow only HTTP and HTTPS** Parse the URL and reject every scheme other than `http` and `https`. Do not rely on string-prefix checks alone. 2. **Reject unsafe destination addresses** Resolve the hostname before making the request and reject all addresses in loopback, private, link-local, multicast, unspecified, and reserved ranges. Apply this policy to both IPv4 and IPv6, including IPv4-mapped IPv6 addresses. 3. **Protect against DNS rebinding** Ensure curl connects to the IP address that was validated. Do not validate one DNS result and then allow curl to perform an independent resolution that may return a different address. 4. **Validate redirects** Either disable redirects or validate the scheme, hostname, and resolved address of every redirect destination before following it. 5. **Terminate curl option processing** Place `--` immediately before the URL: ```bash curl -s --compressed -- "$URL" ``` This prevents an input beginning with `-` from being interpreted as a curl option. 6. **Reject malformed and ambiguous URLs** Reject URLs containing user-information sections, invalid hostnames, control characters, unsupported ports, or parsing ambiguities. Use a dedicated URL parser rather than shell substitutions. 7. **Apply network and filesystem sandboxing** Run retrieval code in an environment without access to sensitive local files, cloud metadata endpoints, loopback administration services, or unrelated private networks. 8. **Fail closed** If validation fails, stop processing and return a clear error. Do not send rejected URLs to a fallback proxy or alternate retrieval tool. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The README prescribes search engine choices based on the query language (e.g. Chinese vs. English) without presenting this as an optional user-controlled preference. In a search-orchestration skill, hardcoded routing can leak user queries to specific regional providers, create censorship or privacy risks, and remove informed consent over where sensitive searches are sent.

Lp3

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding
The skill documents substantial shell-based capabilities including curl, grep, sed, node execution, browser automation, and local file writes, but the manifest does not declare any tool scope restrictions such as permissions or allowed-tools. This creates an overbroad execution surface where a host agent may permit more capability than users expect, weakening least-privilege controls for a skill that appears to be a simple search selector.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
The description is presented as a Chinese-only skill description and the decision logic further prioritizes Chinese-related terms and Taiwan/China contexts without offering any language or locale choice. This creates a natural-language locale constraint that is not framed as optional or justified as a region-specific tool.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill routes user queries and URLs to third-party services such as jina.ai, Firecrawl, Tavily, Brave, DuckDuckGo, and possibly browser-based retrieval without any privacy disclosure. User-provided inputs may include sensitive internal URLs, research topics, or personal data, so transmitting them externally without notice can cause confidentiality and compliance issues.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The documented browser automation loads arbitrary URLs and can save screenshots locally, which materially expands the skill from search routing into active web interaction and data capture. That broader capability increases the chance of sensitive page content being collected from authenticated or dynamic pages, especially because the feature is triggered by heuristics and environment variables rather than an explicit user consent flow.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill describes optional screenshot file creation but does not warn users that local data capture and storage may occur. Screenshots can contain credentials, personal data, internal dashboards, or other sensitive on-screen information, and silent file creation increases the risk of unintended retention or later exposure.

Ssd 3

Medium
Confidence
96% confidence
Finding
The skill instructs persistent execution-history and error logging to files under the user's home/workspace, and those logs are likely to contain queries, URLs, errors, and possibly provider endpoints or page details. Persisting this data without minimization, masking, retention limits, or consent creates a durable privacy leak and increases the blast radius if local files are accessed by other users, processes, or later tooling.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill sends user-supplied queries and URLs to multiple third-party services such as jina.ai, DuckDuckGo, Brave, Firecrawl, and Tavily without prominently warning the user in help text or runtime output. This can leak sensitive research terms, internal URLs, or other confidential targets to external providers, which is especially risky for an automation utility that chooses providers automatically.

Context-Inappropriate Capability

Low
Confidence
80% confidence
Finding
The manifest frames the skill as automatically selecting the best search tool, but these sections add local stateful behavior by storing cached results and call counts on disk. Persistent local storage is not an obvious requirement of strategy selection itself and broadens the operational footprint beyond the stated purpose.

Context-Inappropriate Capability

Low
Confidence
88% confidence
Finding
The manifest presents a focused search-strategy executor, but the roadmap documents planned expansion into document export, OCR, speech, file ingestion, and scheduled pushing of updates. These capabilities materially exceed the stated role of selecting a search tool and indicate intent toward a much broader automation skill.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
Natural-language strings throughout the script, including help and error messages, are exclusively in Chinese, which effectively forces one language for user interaction. There is no opt-in, language selection mechanism, or documented justification that this skill is intended only for a Chinese-speaking or region-specific environment.

Context-Inappropriate Capability

Low
Confidence
82% confidence
Finding
The manifest describes this skill as an automatic search-tool selector/executor. Checking for `TAVILY_API_KEY` introduces credential access behavior, which is not inherent to tool-selection logic itself and expands capability into environment-based secret handling.

Static analysis

No suspicious patterns detected.