Back to skill

Security audit

upload img temp 临时图床上传技能

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real temporary image uploader, but it can upload any readable local file to a public third-party host without validating that the file is an image or requiring a clear confirmation.

Install only if you are comfortable sending selected files to imgland.net and receiving a public temporary URL. Before use, verify the exact path yourself, do not upload screenshots or files containing secrets, personal data, internal documents, or credentials, and treat the returned delete_url as sensitive because anyone with it may be able to delete the hosted image.

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/upload.sh:20
Finding

Arbitrary Local Files Can Be Uploaded to a Public External Service

Content
View full analysis

Vulnerability Details

File Location: scripts/upload.sh:20-36
Vulnerability Type: Insufficient file-type validation before external upload
Risk Level: Medium

Vulnerable Code

bash
if [ ! -f "$IMAGE_PATH" ]; then
  exit 1
fi

FILENAME=$(basename "$IMAGE_PATH")

RESPONSE=$(curl -s -X POST "$API" \
  -H "accept: */*" \
  -F "file=@${IMAGE_PATH}" \
  -F "expiresIn=${EXPIRES}" \
  2>&1)

Technical Analysis

The Skill is documented as an image-upload utility supporting formats such as PNG, JPEG, GIF, WebP, and BMP. However, the implementation only verifies that the supplied path refers to a regular file. It does not validate:

  • The file extension against the documented image allowlist.
  • The detected MIME type.
  • The file signature or magic bytes.
  • Whether the extension, MIME type, and file contents agree.
  • The file size.
  • Whether the user has explicitly approved transferring the resolved file to an external service.

The path is then passed directly to the multipart curl upload using file=@${IMAGE_PATH}. Consequently, any locally readable regular file can be transferred to https://api.imgland.net/v1/images, regardless of whether it is an image.

Shell command injection was not identified because the path and expiration arguments are quoted. The security issue is the missing content and authorization boundary validation before public external transmission.

Attack Path

  1. An attacker-controlled instruction, untrusted prompt, or user mistake causes the Agent to invoke the Skill with the path of a sensitive local file rather than an image.
  2. The script expands a leading tilde and checks only whether the supplied path is a regular file.
  3. Because no extension, MIME, signature, or approved-directory validation is performed, the sensitive file passes the check.
  4. curl uploads the file to the third-party image-hosting API.
  5. The API response provides a public URL, potentially exposing the file to anyone who obtain ...[truncated 816 chars]
Remediation
View remediation

Remediation Suggestions

  1. Enforce a strict allowlist of supported extensions after converting the extension to lowercase.
  2. Detect the file MIME type locally and allow only expected image media types such as image/png, image/jpeg, image/gif, image/webp, and image/bmp.
  3. Validate image signatures or decode the file with a trusted image parser; do not rely solely on extensions or caller-provided MIME types.
  4. Require the extension, detected MIME type, and file signature to agree.
  5. Resolve the canonical file path and present it to the user before upload.
  6. Require explicit user confirmation that the displayed file will be transferred to a third-party public hosting service.
  7. Apply a maximum file-size limit before initiating the network request.
  8. Consider restricting uploads to user-approved directories or files explicitly selected during the current interaction.
  9. Reject symbolic-link and path-resolution anomalies where appropriate for the intended workflow.
  10. Clearly disclose the external destination, public accessibility, retention period, and deletion behavior before uploading.
  11. Minimize exposure of the deletion secret and avoid displaying or logging the deletion URL unless it is necessary for the user.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documents shell execution via a local script but does not declare any tool scope or allowed tools. This weakens reviewability and containment because users and platforms cannot clearly see that the skill will invoke shell capabilities and potentially access local files for upload.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill encourages uploading images to a third-party temporary hosting service but does not clearly warn that the resulting link is publicly accessible. Users may upload screenshots or documents containing secrets, personal data, or internal information without realizing they are being published externally.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

This skill's core function is to transmit local image data to an external service, which is an external data exfiltration pathway by design. In context this is expected rather than overtly malicious, but it is still dangerous because local files may contain sensitive visual information and are made available through a public remote URL.

Content

Scanner excerpt · SKILL.md (reported line 41)May include surrounding context.

json
{
  "url": "https://api.imgland.net/v1/images/xxx/file",
  "id": "h463m2O1",
  "filename": "screenshot.png",
  "file_size": "377716",

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

The exposed delete_url is another externally reachable endpoint tied to the uploaded asset and functions as a bearer-style deletion capability. While not inherently malicious, disclosing it without guidance can enable unintended deletion by anyone who obtains the URL.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

"filename": "screenshot.png", "file_size": "377716", "expires_at": "2026-05-11T00:04:15.5834277+00:00", "delete_url": "https://api.imgland.net/v1/images/h463m2O1/file/uXMJd95M..." }

text

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation states the skill does not provide deletion functionality, yet the sample output exposes a delete_url that can delete the uploaded image. This inconsistency can mislead users about available capabilities and handling of sensitive control URLs, increasing the chance that deletion tokens are exposed or misused.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
98% confidence
Finding

The script is explicitly designed to upload a user-supplied local image file to a third-party internet service, which is a real external data transmission. This is dangerous because files may contain sensitive visual content or metadata and the resulting link is public, while the script performs no content sensitivity checks, confirmation step, domain allowlisting verification beyond a hardcoded URL, or warning about disclosure risks.

Content

Scanner excerpt · scripts/upload.sh (reported line 9)May include surrounding context.

sh
IMAGE_PATH="$1"
EXPIRES="${2:-30d}"
API="https://api.imgland.net/v1/images"

if [ -z "$IMAGE_PATH" ]; then
  echo "用法: upload.sh <图片路径> [过期时间]"

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

The script returns a delete URL containing the delete secret embedded in the URL, which is another external-service exposure point tied to uploaded content management. This is risky because anyone who obtains the output can delete the uploaded file, and exposing service-management secrets in routine output increases accidental leakage through logs, chat transcripts, or downstream tools.

Content

Scanner excerpt · scripts/upload.sh (reported line 66)May include surrounding context.

sh
--arg filename "$FILENAME" \
  --arg file_size "$FILE_SIZE" \
  --arg expires_at "$EXPIRES_AT" \
  --arg delete_url "https://api.imgland.net/v1/images/$ID/file/$DELETE_SECRET" \
  '{url: $url, id: $id, filename: $filename, file_size: $file_size, expires_at: $expires_at, delete_url: $delete_url}'

Static analysis

No suspicious patterns detected.