Back to skill

Security audit

医学文献检索

Security checks for vulnerabilities and agentic risk

Overview

This PubMed literature-search skill is mostly coherent, but its documented curl command can become unsafe if a user query is inserted directly into a shell command.

Review before installing. The skill should be changed to use a structured HTTP request or curl with --get and --data-urlencode for the search term, and it should avoid placing user-provided queries directly inside shell command strings. The medical-literature purpose itself is reasonable, but do not use the shown command pattern with untrusted input as written.

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:6
Finding
Shell Command Injection Through Unescaped PubMed Search Input<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 6-10 **Vulnerability Type**: Shell command injection caused by unsafe input interpolation **Risk Level**: High ### Vulnerable Code ```bash ## Quick Search Search for papers on a topic: ```bash curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=YOUR_QUERY&retmax=10&retmode=json&sort=relevance" ``` ``` ### Technical Analysis The Skill instructs an agent to replace `YOUR_QUERY` directly within a double-quoted shell command. It does not require shell-safe argument handling or URL encoding. If untrusted search input contains a double quote, shell control operators, and a comment marker, it can terminate the quoted URL and introduce another command. For example, substituting the following query: ```text cancer"; id; # ``` would produce a command structurally equivalent to: ```bash curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=cancer"; id; #&retmax=10&retmode=json&sort=relevance" ``` The shell would execute `id` separately from `curl`. An attacker could replace `id` with another command. The absence of URL encoding also permits malformed requests and query-parameter manipulation, although command injection is the primary security risk. The package contains no executable implementation, so exploitation depends on an agent following this documented shell pattern and inserting attacker-controlled input verbatim. ### Attack Path 1. An attacker supplies a crafted medical literature query to an agent using this Skill. 2. The query includes a double quote to terminate the URL string, followed by a shell command and a comment marker. 3. The agent replaces `YOUR_QUERY` directly with the crafted input as instructed. 4. The agent executes the resulting command through a shell. 5. The injected command runs with the operating-system privileges and environment of the agent process. ### Impact Assessment Successful exploitation ...[truncated 678 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Avoid constructing shell commands by inserting user-controlled text into command strings. Use an HTTP client or agent networking tool that accepts query parameters as structured data. If `curl` must be used, place the query in a separate variable and pass it through `--data-urlencode`: ```bash QUERY='user-supplied search term' curl --silent --get \ 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi' \ --data-urlencode 'db=pubmed' \ --data-urlencode "term=${QUERY}" \ --data-urlencode 'retmax=10' \ --data-urlencode 'retmode=json' \ --data-urlencode 'sort=relevance' ``` Additional hardening should include: 1. Explicitly prohibit evaluating or concatenating user input into a shell command. 2. Prefer direct process invocation with an argument array rather than invoking a shell. 3. URL-encode all externally supplied query values. 4. Keep the NCBI host and API path fixed rather than accepting a user-controlled destination. 5. Validate reasonable query length and reject control characters where they are unnecessary. 6. Run the agent with least privilege and without unrelated credentials in its environment. 7. Add tests covering quotes, semicolons, command substitutions, newlines, and other shell metacharacters. ]]>
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger list includes several very broad phrases such as 'PubMed' and 'find papers', which can cause the skill to activate in contexts the user did not intend. In a medical-literature skill, unintended activation can misroute health-related queries, produce unsought medical research summaries, and interfere with safer or more appropriate routing to general medical-information workflows.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The evidence-quality section presents explanatory text in Chinese while the rest of the skill is in English, without indicating that language selection is optional or user-configurable. This can impose a language/locale assumption on users and does not document any justification for the mixed-language output.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The manifest names the skill as "医学文献检索" while the rest of the description is in English, indicating a locale-specific label without any stated user choice or justification. This can violate language/locale policy expectations when users are not given an opt-in or explanation for the enforced language.

Static analysis

No suspicious patterns detected.