Back to skill

Security audit

医学量表检索技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent medical-scale research assistant, but it uses unsafe shell downloading and broad local/cloud publishing of full scale materials that need review before installation.

Review before installing. Use this only with materials you are authorized to download or upload to Feishu, restrict Feishu permissions and target knowledge-base locations, replace the exec curl download with a safer download method, and change the hard-coded local save path to a user-approved workspace path.

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

Shell Command Injection Through Unvalidated Scale Name and Download URL

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 125
Vulnerability Type: Shell command injection
Risk Level: High

Vulnerable Code:

text
2. 使用 exec 下载:curl -L -o "/Users/wangyafei/Downloads/scales/[量表名]_official.pdf" "[PDF_URL]"

Technical Analysis

The Skill instructs the Agent to construct and execute a shell command by directly substituting two untrusted values:

  • [量表名] originates from user input.
  • [PDF_URL] is obtained from external web search results.

Neither value is validated, normalized, or safely escaped before being inserted into the command. Although the placeholders appear inside double quotes, a value containing a double quote followed by shell metacharacters can terminate the intended argument and append a new shell command.

The download URL is also not restricted to HTTPS or an allowlist of authoritative hosts. Redirect-following via curl -L further permits the initial server to redirect the request to an unexpected destination.

This behavior exceeds minimum privilege because downloading a PDF does not require a general-purpose shell. A structured download API or a process invocation with a fixed executable and separate argument array would provide the required functionality with substantially less execution authority.

Attack Path

  1. An attacker supplies a crafted scale name containing quote characters and shell syntax, or causes a malicious URL to appear in the web-derived PDF result.
  2. The Agent substitutes the untrusted value into the documented curl command.
  3. The crafted value closes the quoted filename or URL argument.
  4. Appended shell metacharacters introduce an additional operating-system command.
  5. The Agent invokes the resulting string through exec.
  6. The injected command executes with the same filesystem, network, and process privileges as the Agent runtime.

Impact Assessment

Successful exploitation can provide arbitrary com ...[truncated 582 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace shell-based downloading with a structured HTTP client or dedicated download tool that accepts the URL and destination as separate typed parameters.
  2. If a subprocess is unavoidable, invoke curl using an argument array with shell interpretation disabled.
  3. Restrict downloads to HTTPS URLs.
  4. Validate the final URL after every redirect and allow only approved authoritative domains.
  5. Derive filenames from a strict allowlist, such as ASCII letters, digits, periods, underscores, and hyphens.
  6. Generate the local filename independently rather than incorporating raw user input.
  7. Resolve and normalize the destination path, then verify that it remains within a configurable, user-approved download directory.
  8. Reject URLs containing embedded credentials, unexpected schemes, control characters, or malformed hostnames.
  9. Apply download size and content-type limits, and verify that the resulting file is actually a PDF rather than relying only on a minimum file-size check.
  10. Run the download operation with narrowly scoped filesystem and network permissions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (20)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill mandates obtaining the full official instrument via PDF download or screenshots even though its stated purpose is research and report generation. This expands the capability into copying and redistributing full source materials, which can violate least-privilege expectations, copyright boundaries, and create unnecessary local/remote data handling risk.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow explicitly requires embedding the full official instrument as a downloaded PDF or screenshots in the report. This is dangerous because it operationalizes reproduction and exposure of potentially protected source content, turning a research assistant into a distribution channel and increasing legal, policy, and data-sharing risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README advertises automatic downloading of PDFs/screenshots and automatic creation of Feishu cloud documents, but it does not clearly warn users that content will be fetched from external sites, written to local disk, and transmitted to a third-party cloud workspace. In a skill that handles research materials and may process regulated or proprietary documents, this can lead to unintended data egress, local file persistence, and compliance/privacy issues if users invoke it without understanding those side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation asks for broad Feishu cloud document read/write and knowledge-base management permissions, but it does not explain the scope of access or the possible workspace impact if the skill creates, modifies, or archives documents automatically. Excessive or poorly explained permissions increase the risk of accidental overwrites, unintended publication into shared knowledge bases, and abuse if the skill or its execution context is compromised.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill description is written as a Chinese-only workflow and the examples, triggers, outputs, and report structure consistently assume Chinese-language operation. There is no indication that users may choose another language or that the Chinese-only constraint is an intentional, documented locale limitation.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill tells the agent to include local filesystem paths and downloadable instrument links in generated documents and user-facing output. Exposing concrete local paths leaks environment details and may disclose where copied materials are stored, while direct links to protected content can facilitate further redistribution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The workflow broadens from information retrieval into local archival and cloud propagation of complete instrument files and images. That scope expansion is risky because it causes the agent to retain and redistribute content beyond what is needed to summarize or standardize a report, increasing compliance and exposure risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to write downloaded files to a fixed local path without clear disclosure or user consent. Unannounced local writes can consume disk, overwrite existing files, expose filesystem structure, and violate user expectations about where agent-generated artifacts are stored.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The workflow requires uploading screenshots of scale content to Feishu without clearly warning that content will be transferred to a third-party cloud service. That creates data-transfer and compliance risk, especially if the material is copyrighted, restricted, or the workspace has specific governance requirements.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example output reveals a concrete local file path to the downloaded PDF in user-facing results. This unnecessarily discloses host-specific filesystem information and confirms that the agent stored a local copy, which can aid lateral inference about the environment and normalize unsafe disclosure patterns.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file is entirely framed as a Chinese report template and generated output example, with no indication that users may request another language or locale. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill content describes creating and writing Feishu cloud documents, including insert and overwrite-like operations, but frames them as implementation notes without a clear user-facing warning that remote documents may be created or modified. In an automation context, insufficient disclosure can lead to unintended writes to third-party services, accidental data propagation, or silent modification of shared knowledge bases.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The fallback unconditionally maps any unmatched input to QS/ADQS, which can silently misclassify non-questionnaire instruments such as medical history, adverse events, labs, or response criteria. In this skill's context, the mapping is used to generate standardized medical research outputs, so a broad default can propagate incorrect CDISC domain assignments into downstream documentation or knowledge bases without obvious warning.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire template forces Chinese-language output and labels without any indication that the user can choose another language or locale. Under the policy, fixing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The template explicitly supports downloading and locally storing the full official scale PDF, including a hard-coded local path and instructions to access the complete instrument. For a research/report-generation skill, retaining full copyrighted scale content exceeds minimal metadata retrieval and creates avoidable intellectual-property and data-governance risk, especially if reports are shared or synced to external knowledge bases.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The template provides a direct PDF download/local-path pattern for the official scale text and presents it as a normal step, while only adding a minimal usage note later. That design can encourage operators to download and persist potentially copyrighted materials without clear consent, storage safeguards, or prominent compliance review.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The appendix records full-text acquisition details, including download or screenshot methods, source list, file name, size, and file path. This operationalizes collection and retention of complete scale content beyond simple research summarization, increasing the likelihood of unauthorized copying, redistribution, and persistence of copyrighted material in downstream systems.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The README presents all operational instructions, examples, and warnings in Chinese only. Under the policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale limitation is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The example report includes concrete local filesystem paths under a user's home directory, which unnecessarily reveals host-specific environment details unrelated to the report's business purpose. While the exposure is limited, such information can aid fingerprinting, leak usernames, and normalize unsafe handling of local file locations in generated artifacts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Natural-language fields throughout the file are primarily written in Chinese, while some content is in English, and there is no indication that users can opt into the language choice or that the skill is intentionally limited to a Chinese-speaking context. This may violate language/locale policy when a specific language is effectively imposed without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.