Back to skill

Security audit

七牛云对象存储

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims: uploads a user-selected local file to Qiniu object storage and returns a public or signed delivery URL, with some disclosure and reliability improvements advisable.

Install only if you intend agents to upload selected local files to Qiniu using the configured Qiniu credentials. Avoid using it for sensitive or regulated files unless the bucket, domain, and public/private settings are correct; treat generated signed URLs as shareable access tokens until they expire. Large uploads may consume significant memory or hang because the script lacks streaming and network timeouts.

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

Warning
Location
scripts/common.py:227
Finding

Unbounded Memory Consumption and Indefinite Network Wait During File Upload

Content
View full analysis

Vulnerability Details

File Location: scripts/common.py:227 and scripts/common.py:262-263
Vulnerability Type: Resource exhaustion and missing network timeout
Risk Level: Medium

Vulnerable Code

python
chunks.append(file_path.read_bytes())
python
with urlopen(request) as response:
    result = json.loads(response.read().decode("utf-8"))

Technical Analysis

The multipart encoder reads the entire selected file into memory using Path.read_bytes(). The resulting chunks are subsequently joined into another complete in-memory byte string, potentially requiring memory substantially greater than the original file size.

The upload response is also read without a maximum response-size limit. A large response from the remote service or an intermediary could therefore consume additional unbounded memory.

Furthermore, urlopen(request) is invoked without a timeout. If the upload endpoint, network connection, proxy, or TLS session stalls, the process can remain blocked indefinitely.

These operations are unnecessary expansions of the resources required for the declared object-storage functionality. Streaming the file and applying bounded network operations would satisfy the same functionality with less risk.

Attack Path

  1. An attacker or untrusted workflow causes the Skill to upload a very large local file.
  2. The script reads the entire file into memory.
  3. Multipart assembly duplicates that data when the chunks are joined into the final request body.
  4. The process exhausts available memory, becomes unresponsive, or is terminated by the operating system.
  5. Alternatively, a remote endpoint, proxy, or disrupted connection accepts the connection but stalls the response.
  6. Because no timeout is configured, the Agent workflow remains blocked indefinitely.
  7. A malicious or abnormal server response could also consume excessive memory because the response body has no size limit.

...[truncated 799 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the in-memory multipart construction with a streaming upload implementation that reads the file in bounded chunks.
  2. Enforce a documented maximum upload size before opening or reading the file.
  3. Configure explicit connection and read timeouts for outbound upload requests.
  4. Add a maximum accepted response size and stop reading once that limit is exceeded.
  5. Validate the response content type and JSON structure before processing it.
  6. Handle timeout, network, malformed-response, and resource-limit errors explicitly, returning a controlled failure rather than leaving the workflow blocked.
  7. Consider rejecting non-regular files to avoid unexpected behavior when the supplied path refers to a device, pipe, or other special filesystem object.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented behavior claims end-to-end upload and delivery-link generation with automatic type detection and public/private handling, but the analyzed implementation apparently only generates private signed URLs for existing object keys. This mismatch is dangerous because downstream agents or users may trust the skill to perform one action while it actually performs another, leading to incorrect security assumptions, accidental exposure patterns, or misuse of existing stored objects.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares executable behavior that uses environment secrets, local file access, and network upload/signing operations, but it does not define an explicit tool scope such as permissions or allowed-tools. This can cause the agent platform to invoke the skill with broader capabilities than reviewers or users expect, increasing the risk of unintended file access, secret use, or external data transfer.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The invocation description includes generic phrases such as "上传", "交付链接", and activation based on entering a "delivery stage" of a workflow. These conditions are broad enough that the skill could be invoked in ordinary conversations or general content-delivery contexts without clear boundaries or negative examples.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The usage guide instructs users to upload local files to Qiniu and generate public or signed delivery links, but it does not clearly disclose that files are being transmitted to an external third-party cloud service. This can lead to accidental exposure of sensitive or regulated data, especially because the skill is positioned as a delivery step in automated workflows and may return public links by default for public buckets.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file contains user-visible log/error strings in Chinese, such as the provider prefix and later runtime messages, with no indication that the skill is intended only for Chinese-speaking users or that language is configurable. This can violate language/locale policy when a specific language is forced without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This raised error message is written only in Chinese and provides no locale fallback or opt-in. In the absence of documented regional scope, forcing one language in user-facing failures can violate language/locale policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The missing-environment-variable error is presented only in Chinese, with no apparent language selection or justified locale constraint. That makes the skill's user-facing behavior language-specific without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The validation message for mutually exclusive options is user-facing text written only in Chinese. Without an explicit locale limitation or user language choice, this is a language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code reads a local file and sends its contents to a remote upload endpoint using a multipart HTTP POST. Although the function name implies uploading, there is no confirmation prompt or explicit user disclosure in this file that local data will be transmitted off-system.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The argparse description and help/error strings are written only in Chinese, which imposes a specific language on all users of the script. There is no opt-in, alternate locale, or documentation indicating that this skill is intentionally limited to a Chinese-speaking environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

A skill document that forces a single language can violate language/locale policy when no user opt-in or justification is provided. Here, all headings and instructions are presented only in Chinese, with no indication that the skill is restricted to a Chinese-speaking audience or that alternative language support is unavailable.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This code prints a usable private download URL to stdout, which can be copied, logged, or stored by shells and calling systems. Although the script purpose is to generate such a URL, there is no user-facing warning or disclosure in the file that the output grants temporary access to a private object and should be handled carefully.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

All visible CLI descriptions, help text, and error messages in this script are written in Chinese, which imposes a specific language on users with no opt-in or fallback. The policy explicitly calls out language or locale constraints as a natural-language violation unless the tool offers user choice or clearly documents a justified regional scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code sets DEFAULT_EXPIRES_IN to 1800 seconds at L021 and uses it as the default for --expires-in at L078, but the help text claims the default is 600 seconds. This is an inline documentation mismatch that can mislead users about the behavior of generated signed URLs.

Content

No source excerpt is available for this finding.