Back to skill

Security audit

Deep Research with MCP

Security checks for vulnerabilities and agentic risk

Overview

This research skill is not clearly malicious, but it needs review because it fetches arbitrary web URLs with an unsafe shell command and saves reports into the workspace.

Install only if you are comfortable allowing the agent to perform web searches, fetch pages, and write reports into the workspace. Prefer using a hardened fetcher or manually reviewed HTTPS URLs instead of the provided raw curl pattern, especially in environments with secrets, internal network access, or sensitive project files.

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:105
Finding
Unvalidated Search Result URL Interpolated into a Shell Command<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 105-112 **Vulnerability Type**: Command injection and unrestricted resource retrieval **Risk Level**: High ### Vulnerable Code ```bash curl -sL "<url>" | python3 -c " import sys, re html = sys.stdin.read() # Strip tags, get text text = re.sub('<[^>]+>', ' ', html) text = re.sub(r'\s+', ' ', text).strip() print(text[:5000]) " ``` ### Technical Analysis The workflow instructs the agent to replace `<url>` with a URL obtained from web-search results and interpolate it directly into a shell command. The URL is not validated or safely passed as a non-shell argument. If a crafted search result contains quotation marks or shell metacharacters, textual substitution can terminate the quoted `curl` argument and append attacker-controlled shell syntax. Any injected command would execute with the permissions of the account running the agent. The flagged pipeline does not inherently download and execute a remote script: the response body is passed as data to a fixed Python parser rather than evaluated as Python or shell code. The vulnerability instead arises from unsafe construction of the surrounding shell command. The retrieval operation also lacks destination restrictions. Curl supports schemes beyond HTTP and HTTPS, while `-L` follows redirects without validating each destination. A malicious URL or redirect could therefore target local files, loopback services, private-network systems, link-local endpoints, or cloud instance metadata. This network and local-resource access exceeds the minimum privileges required to retrieve public research pages. ### Attack Path 1. An attacker causes an MCP search provider or indexed web page to return a crafted URL. 2. The agent selects that URL as a key research source. 3. The agent substitutes the untrusted value into the documented shell command. 4. One of the following exploitation paths occurs: - Shell syntax in the URL escapes the quoted argument ...[truncated 1105 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not construct shell commands through textual URL interpolation. Use a dedicated HTTP client or invoke curl through an argument-array API that bypasses shell parsing. 2. Permit only explicitly required schemes, preferably `https`; allow `http` only if there is a documented operational need. 3. Parse and validate each URL before retrieval. Reject embedded credentials, control characters, malformed hosts, shell metacharacters, and unsupported schemes. 4. Resolve hostnames and block loopback, link-local, private, multicast, unspecified, and reserved address ranges for both IPv4 and IPv6. 5. Disable redirects where possible. If redirects are required, apply the complete scheme, hostname, DNS, and IP validation process to every redirect target. 6. Apply strict connection, transfer, and overall timeouts, as well as a maximum response size. 7. Use curl hardening options where curl remains necessary, including explicit protocol restrictions such as `--proto '=https'` and redirect-protocol restrictions such as `--proto-redir '=https'`. 8. Treat all fetched content as untrusted data. Explicitly instruct the agent not to execute commands or follow operational instructions contained in retrieved pages. 9. Run the retrieval component in a sandbox with minimal filesystem permissions, no unnecessary credentials, and restricted outbound network access. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

External Script Fetching

High
Category
Supply Chain
Content
For the most promising URLs, fetch full content:

```bash
curl -sL "<url>" | python3 -c "
import sys, re
html = sys.stdin.read()
# Strip tags, get text
Confidence
97% confidence
Finding
The skill fetches arbitrary remote URLs with curl and pipes the response directly into Python for processing. Even though the Python snippet is fixed, this still causes the agent to retrieve attacker-controlled content, enabling SSRF against internal resources, access to metadata endpoints, large-response denial of service, and unsafe handling of untrusted data outside the MCP trust boundary.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The README’s invocation examples are phrased as ordinary user requests rather than clearly scoped skill triggers, which can cause an agent framework to activate this skill unintentionally during normal conversation. In this skill’s context, unintended activation can lead to unnecessary web searching, external content retrieval, and workspace writes, expanding data exposure and increasing the chance of prompt-injection or untrusted-content processing from fetched pages.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The instruction "When the user asks for research on any topic" does not define specific trigger phrases, boundaries, or exclusion conditions. This broad wording could overlap with many ordinary requests and make it unclear when the skill should activate versus when a normal conversational response is more appropriate.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill instructs writing a report into the current working directory without notifying the user or requiring confirmation. In agent environments, silent file writes can create unintended persistence, overwrite nearby project artifacts, or leave unreviewed content in shared workspaces.

Static analysis

No suspicious patterns detected.