Back to skill

Security audit

文件上传,本地文件转网络路径

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed file uploader, but it needs review because it uploads local files to a public cloud URL while handling credentials and upload limits unsafely.

Review this before installing. Only use it for files you are comfortable uploading to an external service and potentially exposing through a direct URL. Avoid configuring the JWT through a normal shell command unless the author changes the flow to read secrets safely, and ask the author to fix the upload-size limit and add an explicit confirmation step before upload.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:30
Finding

JWT Token Exposure Through Command-Line Arguments

Content
View full analysis
"$CONFIG" ``` ### Technical Analysis The documented configuration interface requires the JWT token to be supplied as a command-line argument. Command-line secrets can be exposed through: - Shell history files. - Process-listing utilities while the command is running. - Process auditing and monitoring systems. - Diagnostic logs that capture executed commands. Passing the token to `jq` with `--arg` does not remove this risk because the token is also included in the `jq` process arguments. Applying file mode `600` to the resulting configuration file only protects the stored copy; it does not protect the earlier command-line exposure. ### Attack Path 1. A user follows the documented configuration procedure and provides the JWT token as a command-line argument. 2. The shell may persist the complete command, including the token, in its history. 3. While configuration is running, the token may also appear in the script or `jq` process arguments. 4. A local attacker, monitoring process, or user with access to the relevant history or audit data obtains the token. 5. The attacker combines the JWT with the associated device identifier and authenticates to the upload service as the victim. ### Impact Assessment Successful exploitation could disclose the user's upload-service JWT. An attacker could then impersonate the affected user within the authorization scope granted by that token, including submitting files or accessing other API capabilities permitted by the service. This issue does not directly provide operating-system privilege escalation. Exploitation generally requires local access to process informa ...[truncated 138 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:65
Finding

Defective and Inconsistent File-Size Validation

Content
View full analysis
/dev/null || stat -f%z "$FILE") if [ "$SIZE" -gt $((100*1024*1024) ]; then echo "文件超过大小限制" exit 1 fi ``` ### Technical Analysis The implementation has two separate defects: 1. The stated security restriction is 4 MB, while the code compares the file size against 100 MB. 2. The arithmetic expansion is missing a closing parenthesis. A valid expansion would require `$((100*1024*1024))`. Because shell parsing occurs before normal execution, the malformed arithmetic expression can terminate the script with a syntax error and prevent the upload workflow from operating. If only the syntax error is repaired while retaining the existing numeric threshold, files between 4 MB and 100 MB would bypass the documented safety limit. The code also assumes that `stat` returns a valid numeric value. It does not explicitly reject an empty or nonnumeric result before using it in an integer comparison. ### Attack Path **Current implementation:** 1. A user invokes the documented uploader. 2. The shell parses the malformed arithmetic expansion in the size check. 3. Parsing fails, terminating the script and denying the upload function. **If the syntax is corrected without correcting the threshold:** 1. A user or untrusted caller selects an allowed file type larger than 4 MB but no larger than 100 MB. 2. The extension check succeeds. 3. The incorrect 100 MB comparison accepts the file despite the stated 4 MB restriction. 4. The oversized file is transmitted to the remote upload endpoint. 5. Repeated submissions can consume additional bandwidth, processing time, remote storage ...[truncated 643 chars]
Remediation
View remediation
&2 exit 1 fi if [ "$SIZE" -gt "$MAX_SIZE" ]; then echo "File exceeds the size limit" >&2 exit 1 fi ``` - Treat failure of both `stat` variants as a validation failure rather than continuing with an empty value. - Ensure the server independently enforces the same or a stricter size limit; client-side validation is not a security boundary against modified clients. - Add automated tests for files immediately below, equal to, and immediately above the 4 MB limit. - Run shell syntax validation, such as `bash -n`, and static analysis, such as ShellCheck, before distribution. - Keep the documented limit, client implementation, and server-side policy synchronized. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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 (6)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill description says it uploads local files to Alibaba Cloud OSS and returns a public URL, but it does not provide a prominent user-facing warning that local files are being transmitted to an external service and may become directly accessible on the web. In a file-handling skill, this omission is especially dangerous because users may unknowingly disclose sensitive documents, images, or media to a third party.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases are broad and likely to match common requests such as uploading an image or document, which can cause the skill to activate in contexts where the user did not clearly consent to sending a local file to a third-party service. In this skill's context, broad activation is more dangerous because it handles local files and transmits them externally, creating a privacy and data-exfiltration risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill documents a 4MB maximum upload size, but the implementation permits files up to 100MB. This mismatch can cause users or downstream systems to trust a stricter limit than is actually enforced, increasing the risk of unexpected large-file exfiltration, bandwidth abuse, and operational impact when the skill uploads user-provided local files to an external service.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
--arg token "$2" \
    --arg device "$4" \
    '{jwt_token: $token, device_id: $device}' > "$CONFIG"
  chmod 600 "$CONFIG"
  echo "配置已保存"
  exit 0
fi

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

All natural-language instructions, triggers, and outputs in the skill file are presented only in Chinese, with no indication that the user can choose another language. This can violate a language-choice policy when a skill imposes a locale without opt-in or justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The documentation claims that all error information is desensitized and does not expose server details, but the code directly captures the full server response in RESP at L71-L77 and extracts URLs from it at L79. While failures currently print a generic message, the implementation does not demonstrate comprehensive sanitization of server-returned content, which weakens the documented guarantee.

Content

No source excerpt is available for this finding.