Back to skill

Security audit

Pro Color Palette

Security checks for vulnerabilities and agentic risk

Overview

This palette skill mostly does what it says, but its image URL feature makes unrestricted network requests and writes to a predictable temporary file, so users should review it before installing.

Install only if you are comfortable reviewing and controlling URL inputs. Prefer local image files, avoid untrusted or internal/private URLs, and consider patching the extractor to validate destinations, limit response size, check image types, and use secure temporary files before use in a shared or server environment.

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
extract_palette.py:60
Finding

Unrestricted Remote Image Fetching Enables Server-Side Request Forgery and Resource Exhaustion

Content
View full analysis

Vulnerability Details

File Location: extract_palette.py, lines 60–63 and 183–187
Vulnerability Type: Server-Side Request Forgery and Unbounded Remote Response Processing
Risk Level: Medium
Category: T09: Insecure Skill Coding Practices

Vulnerable Code

python
def extract_colors(img_path, n=6):
    """用像素采样 + K-Means 提取 n 种主色"""
    try:
        img = Image.open(img_path)
    except Exception:
        resp = requests.get(img_path, timeout=10)
        img = Image.open(io.BytesIO(resp.content))
python
# 下载URL图片
if img_arg.startswith("http"):
    resp = requests.get(img_arg, timeout=10)
    img_path = "/tmp/extracted_source.png"
    with open(img_path, "wb") as f:
        f.write(resp.content)
else:
    img_path = img_arg

Technical Analysis

The command-line argument is used directly as the destination of requests.get(). The implementation does not validate the URL hostname or resolved IP address and does not reject loopback, link-local, private, reserved, or cloud metadata destinations. Redirects are enabled by default, but redirect targets are not revalidated.

Consequently, an attacker who can control the image URL can make the host running the Skill issue HTTP requests to destinations that may not be reachable from the attacker's own network. This is a blind SSRF condition because the script does not directly print the fetched response, although response behavior, errors, processing time, and image-decoding success can reveal limited information. GET endpoints with side effects could also be triggered.

The code additionally accesses resp.content, which buffers the complete response in memory, and then writes it to disk or passes it to Pillow. The ten-second timeout limits request duration but does not limit response size. There is no HTTP status validation, content-type validation, streaming byte limit, or decoded image-dimension limit. A malicious server ...[truncated 1570 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse URLs with urllib.parse.urlsplit() and permit only explicit http and https schemes.
  2. Resolve the hostname before connecting and reject every loopback, private, link-local, multicast, reserved, unspecified, and otherwise non-global IP address.
  3. Explicitly block well-known metadata destinations, including link-local metadata addresses.
  4. Disable redirects or manually follow a small number of redirects while repeating scheme, hostname, DNS, and resolved-address validation for every target.
  5. Use stream=True, inspect Content-Length when available, and stop reading after a strict maximum number of bytes.
  6. Call raise_for_status() and reject responses whose content type is not an approved image type.
  7. Configure separate connection and read timeouts.
  8. Set Pillow image-dimension and decompression-bomb limits, and reject images exceeding an application-defined pixel count.
  9. Avoid downloading the same URL twice. Process a single bounded response from memory or from a securely created temporary file.
  10. Where remote images are not essential, disable URL input and accept only trusted local files.

T09 · Insecure Skill Coding Practices

Warning
Location
extract_palette.py:183
Finding

Predictable Temporary File Allows Symlink-Based File Overwrite

Content
View full analysis

Vulnerability Details

File Location: extract_palette.py, lines 183–187
Vulnerability Type: Insecure Temporary File Creation and Symlink Following
Risk Level: Medium
Category: T09: Insecure Skill Coding Practices

Vulnerable Code

python
# 下载URL图片
if img_arg.startswith("http"):
    resp = requests.get(img_arg, timeout=10)
    img_path = "/tmp/extracted_source.png"
    with open(img_path, "wb") as f:
        f.write(resp.content)

Technical Analysis

Remote image data is written to the fixed path /tmp/extracted_source.png. The shared temporary directory is normally writable by other local users, and the filename is predictable.

Python's open(..., "wb") follows symbolic links and truncates an existing target. It does not request exclusive file creation or verify that the resulting file is a newly created regular file. A local attacker can therefore create /tmp/extracted_source.png as a symbolic link before the Skill runs. When a victim processes a remote image, the Skill follows the link and writes attacker-selected downloaded bytes into the linked target.

The practical target is limited to files writable by the account executing the Skill. Exploitation also requires local access or another mechanism capable of creating filesystem entries in /tmp before execution.

Attack Path

  1. A local attacker identifies that the Skill uses the fixed path /tmp/extracted_source.png.
  2. Before the victim invokes the URL extraction feature, the attacker creates that path as a symbolic link to a file writable by the victim's account.
  3. The attacker causes or waits for the victim to process an attacker-controlled URL.
  4. The Skill downloads the attacker's chosen response body.
  5. open(img_path, "wb") follows the symbolic link and truncates the linked target.
  6. The downloaded bytes overwrite the target file under the privileges of the Skill process.

Impact Assessment

Th ...[truncated 612 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prefer eliminating the intermediate file and process a size-limited response from an in-memory buffer.
  2. If a file is required, use tempfile.NamedTemporaryFile() or tempfile.mkstemp() to create a unique file atomically with restrictive permissions.
  3. Keep the returned file descriptor open while writing rather than reopening a generated pathname.
  4. Place temporary files in a private directory created with tempfile.TemporaryDirectory().
  5. Ensure cleanup occurs in a finally block or through a context manager.
  6. Do not use a constant path in a shared temporary directory.
  7. Run the Skill as a dedicated, unprivileged account with access only to required output locations.
  8. For defense in depth, verify that any opened temporary object is a regular file and avoid APIs that follow symbolic links where supported.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented capabilities materially diverge from the detected implementation, including undeclared remote fetching and missing advertised features. Description-behavior mismatches are dangerous because they undermine informed consent and trust boundaries: users may provide files, URLs, or prompts assuming one processing model while the skill behaves differently, including potential network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented capabilities materially diverge from the detected implementation, including undeclared remote fetching and missing advertised features. Description-behavior mismatches are dangerous because they undermine informed consent and trust boundaries: users may provide files, URLs, or prompts assuming one processing model while the skill behaves differently, including potential network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented capabilities materially diverge from the detected implementation, including undeclared remote fetching and missing advertised features. Description-behavior mismatches are dangerous because they undermine informed consent and trust boundaries: users may provide files, URLs, or prompts assuming one processing model while the skill behaves differently, including potential network activity.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises behavior that can involve network access (image URLs and external AI image generation) but does not declare any tool scope or permissions. This creates a transparency and policy gap: agents or users may invoke the skill without understanding that data could leave the local environment or that remote fetching is part of execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation instructs users to pass image URLs without warning that the skill may fetch remote content. Remote URL fetching can expose user metadata/IP, retrieve untrusted content, and create SSRF-style risk if internal or sensitive endpoints are reachable through the runtime environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill tells users to use an external AI image generation integration without disclosing that prompts and possibly palette/context data will be sent to a third-party service. This is a data handling transparency issue and can lead to unintended sharing of sensitive prompts, assets, or proprietary design information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring states the file extracts dominant colors and generates a palette card, and the implementation only performs image color extraction plus optional card rendering. This falls materially short of the manifest's broader claims such as supporting 12 preset palette workflows, automatic 3-color scheme generation as the main function, and generating scene mockups like posters, phone UI, or covers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module description is written as an instruction-like skill summary in Chinese, with no indication that language is selectable or user-driven. Under the language/locale policy, forcing a specific language without user opt-in can be a policy violation unless clearly justified or configurable.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script performs outbound network requests to attacker-controlled or user-supplied URLs without any guardrails or explicit disclosure. In agent or server environments, this can be abused for SSRF-style access to internal services or unintended network interactions, making the behavior more dangerous than a normal local image-processing utility.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

SQP-3 applies to all file types and includes language or locale policy violations. The module docstring and later CLI help text present the skill exclusively in Chinese, with no opt-in or indication that the tool is intentionally region-specific, which can exclude users expecting language choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI usage block is natural-language content embedded in code, so it falls under SQP-3. Because all guidance is in Chinese and the script does not offer an alternative language or note a justified locale restriction, it violates the language-choice requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language instructions and descriptions in Chinese, including the module docstring and later CLI usage examples, but it does not give users an option to select another language or explain that the tool is intentionally Chinese-only. That creates a locale-policy issue under the rule for forced language without user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes extracting dominant colors from images, generating scene mockups such as posters/mobile UI/covers, and auto-generating 3-color schemes from an input main color. This file instead contains a fixed palette library, simple scene-keyword mapping, image rendering of palette cards, and format export, with no image-analysis logic, no mockup composition, and no algorithm that derives palettes from a user-supplied base color.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest description forces a specific language presentation and does not indicate that users can choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the stated policy, fixed language behavior without opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code defines 12 preset palettes, but the executable flow never exposes them to users or uses find_similar to return preset-based recommendations. Instead, the generated card only shows extracted colors plus two algorithmic suggestions, so the stated preset-palette support is not realized in practice here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
74% confidence
Finding

When opening an image path fails, the function falls back to downloading the provided input via requests, and the CLI also explicitly downloads HTTP URLs. Although image input may reasonably include URLs, the manifest description centers on palette generation features rather than this network-fetching behavior for arbitrary image sources.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

When the input is a URL, the script saves the fetched image to /tmp/extracted_source.png, which is a file write affecting the local system. Although this behavior is straightforward in code, there is no explicit warning in the help text, comments, or printed output that a temporary file will be created.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The top-level docstring advertises broader capabilities than the implementation provides. '智能选色' suggests algorithmic color selection, but smart_select_palette merely maps keywords to hardcoded palette names; similarly, '批量导出' implies exporting assets or data, while the implemented batch function only renders all predefined cards to files.

Content

No source excerpt is available for this finding.