Back to skill

Security audit

Yufluent Clawhub Publish Yufluentcn Ecommerce Imaging

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real cloud image-generation client, but it can upload arbitrary local files and send API tokens to configurable endpoints without enough guardrails.

Review this before installing. Only use it with non-confidential product images you intend to upload, keep TOKENAPI_KEY secret, avoid setting TOKENAPI_BASE_URL unless you trust the exact endpoint, and prefer HTTPS production endpoints. Do not pass arbitrary local paths as --source-image; provide only actual image files you have approved for remote processing.

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
scripts/cloud_cli.py:25
Finding

Unrestricted Local File Encoding and Upload Through Source Image Parameter

Content
View full analysis

Vulnerability Details

File Location: scripts/cloud_cli.py:25-44; data is subsequently transmitted by scripts/run.py:94-99 and scripts/run.py:124
Vulnerability Type: Unrestricted local file read and network upload
Risk Level: Medium

Vulnerable Code

python
def encode_image_source(source: str) -> str:
    """Local path → data URI; http(s)/data: returned unchanged."""
    raw = (source or "").strip()
    if not raw:
        raise ValueError("source_image is empty")
    if raw.startswith(("http://", "https://", "data:")):
        return raw
    path = Path(raw)
    if not path.is_file():
        raise ValueError(f"source_image file not found: {raw}")
    data = path.read_bytes()
    suffix = path.suffix.lower()
    if suffix == ".png":
        mime = "image/png"
    elif suffix == ".webp":
        mime = "image/webp"
    elif suffix in (".jpg", ".jpeg"):
        mime = "image/jpeg"
    else:
        mime = "image/jpeg"
    encoded = base64.b64encode(data).decode("ascii")
    return f"data:{mime};base64,{encoded}"

The resulting value is added to the cloud request:

python
if args.source_image:
    try:
        payload["source_image"] = encode_image_source(args.source_image)
    except ValueError as exc:
        print(f"Error: {exc}", file=sys.stderr)
        return 1
python
data = run_skill(SKILL_API_ID, payload, timeout=300.0)

Technical Analysis

The source-image handler accepts any path that resolves to a regular file and reads its complete contents. It does not verify that the data is actually an image, inspect its file signature, enforce an approved input directory, reject symbolic links, or impose a file-size limit.

Files with unsupported extensions are labeled as image/jpeg rather than rejected. Base64 is legitimate transport encoding and is not, by itself, evidence of covert exfiltration. The security problem is that arbitrary file contents can be encoded and included in a network request while ...[truncated 1452 chars]

Remediation
View remediation

Remediation Suggestions

  1. Resolve the supplied path to its canonical form and require it to reside under an explicitly approved upload directory.
  2. Reject symbolic links unless there is a documented need to support them.
  3. Permit only explicitly supported image formats.
  4. Validate image content using file signatures and a maintained image-decoding library; do not trust the extension.
  5. Reject files whose detected type does not match the declared MIME type.
  6. Enforce conservative limits on file size, decoded dimensions, and total pixel count before encoding.
  7. Stream uploads where the API supports multipart transfer instead of holding the original and encoded copies in memory.
  8. Require explicit user confirmation showing the canonical path, destination host, detected type, and file size before transmitting a local file.
  9. Do not label unsupported files as JPEG; fail closed with a clear error.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/yufluent_api.py:20
Finding

Bearer Credentials and Sensitive Payloads Can Be Sent to Arbitrary Plaintext Endpoints

Content
View full analysis

Vulnerability Details

File Location: scripts/yufluent_api.py:20-27, scripts/yufluent_api.py:55-63, scripts/yufluent_api.py:138-150, and scripts/yufluent_api.py:232-235
Vulnerability Type: Insufficient destination and transport-security validation
Risk Level: Medium

Vulnerable Code

python
def normalize_api_root(base_url: str) -> str:
    base = (base_url or "").strip().rstrip("/")
    if not base:
        base = "http://localhost:8080/v1"
    if base.endswith("/v1"):
        return base
    return f"{base}/v1"
python
def _auth_headers(api_key: str) -> dict[str, str]:
    return {
        "Authorization": f"Bearer {api_key}",
        "Accept": "application/json",
    }


def _json_headers(api_key: str) -> dict[str, str]:
    return {**_auth_headers(api_key), "Content-Type": "application/json"}
python
def _post_json(
    url: str,
    *,
    api_key: str,
    body: dict[str, Any] | None = None,
    timeout: float,
) -> requests.Response:
    kwargs: dict[str, Any] = {
        "headers": _json_headers(api_key) if body is not None else _auth_headers(api_key),
        "timeout": timeout,
    }
    if body is not None:
        kwargs["json"] = body
    return requests.post(url, **kwargs)
python
root = base_url or os.getenv("TOKENAPI_BASE_URL", "")
url = skill_run_url(root, skill_id)
try:
    resp = _post_json(url, api_key=key, body=payload, timeout=timeout)
except requests.RequestException as exc:
    raise YufluentApiError(f"Request failed: {exc}") from exc

Technical Analysis

TOKENAPI_BASE_URL or the programmatic base_url argument controls the destination that receives both the bearer credential and the complete request body. The code performs only string normalization. It does not enforce HTTPS for remote destinations, restrict the destination to an approved service hostname, validate ports, or reject URL user-information and other unexpected URL components.

The documented default of `ht ...[truncated 2333 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require HTTPS for every non-loopback destination.
  2. Permit plaintext HTTP only for verified loopback addresses such as 127.0.0.1, ::1, or an explicitly enabled development mode.
  3. Enforce an allowlist containing the documented production API hostname.
  4. Parse URLs with a standard URL parser and reject unexpected schemes, user-information, fragments, ports, and malformed hostnames.
  5. Resolve and validate hostnames carefully if private-network access is not required, accounting for DNS rebinding and alternate IP representations.
  6. Avoid sending bearer credentials across redirects; explicitly disable redirects or validate every redirect destination before following it.
  7. Separate development and production configuration so a production token cannot be used with an arbitrary development endpoint.
  8. Display or log the selected destination host without logging the token, and require confirmation when a non-default endpoint is used.
  9. Replace the /agent/turn fallback with a structured service call that does not serialize all payload fields into conversational text.
  10. Apply server-side token scoping, rate limits, spending limits, revocation support, and short token lifetimes to reduce the impact of credential disclosure.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (27)

Tainted flow: 'url' from os.getenv (line 271, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The code allows the request destination to be derived from TOKENAPI_BASE_URL or a caller-supplied base_url with no validation, then sends both the bearer token and request payload to that URL. If an attacker can influence environment variables, configuration, or inputs, this becomes an SSRF/exfiltration path that leaks credentials and user data to an arbitrary host; the localhost default also increases risk of unintended access to local services when misconfigured.

Content

Scanner excerpt · scripts/yufluent_api.py (reported line 150)May include surrounding context.

python
}
    if body is not None:
        kwargs["json"] = body
    return requests.post(url, **kwargs)


def _raise_for_status(resp: requests.Response) -> None:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 12)May include surrounding context.

powershell
cd skills\yufluentcn-ecommerce-imaging
pip install -r requirements.txt
copy .env.example .env
# 编辑 TOKENAPI_KEY = "tk-***"

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description promises an AI image-generation skill for e-commerce product imagery, including white-background images, scene images, cutouts, multi-angle sets, and multi-platform sizing through a cloud proxy workflow. However, the supplied code chunk only implements shared CLI helper functions: reading text arguments from files, encoding a local image file as a data URI, and printing returned API results/metadata. These are support utilities and do not demonstrate the core declared behavior of generating or transforming product images. Because the actual code’s primary purpose in this chunk is generic input/output handling rather than the advertised image-generation workflow, the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## 快速开始(3 步,60 秒)

1. **注册获取 API 密钥** → https://claw.changzhiai.com/login (新用户即送体验积分,无需绑卡)
2. **设置环境变量**:export TOKENAPI_KEY=*** 或写入 .env 文件
3. **运行**:参照下方 Examples 示例执行 python scripts/run.py ...

> 还没注册?前往 https://claw.changzhiai.com/login 免费获取密钥。

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README instructs users to supply an API key and send product and source images to a cloud-backed image generation service, but it does not warn that these assets and prompts may be transmitted to remote infrastructure or logged by third parties. In an e-commerce imaging skill, uploaded source photos can contain unreleased product designs, branding, EXIF metadata, or other sensitive business information, so omission of privacy and credential-handling guidance creates a real security and data exposure risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises network, file-read, and environment-variable use via openclaw metadata and instructions, but it does not declare an explicit tool/permission scope. That creates an authorization and transparency gap: an agent may invoke capabilities broader than a user expects, including reading local paths and sending data to a remote service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill states that users may provide local file paths or URLs for source images and that output is generated through a Yufluent/Replicate-backed cloud flow, but it does not clearly warn that those local images, prompts, and related metadata may be transmitted off-device. This is a meaningful privacy and data-handling issue, especially for proprietary product photography, unreleased listings, or customer assets.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to match many ordinary product-image requests, which can cause unintended invocation of a paid remote service or transmission of sensitive images/prompts without sufficiently specific user intent. In an agent ecosystem, ambiguous routing increases the chance of surprise execution and accidental data disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s title and usage instructions are written only in Chinese, which imposes a specific language on users without any opt-in or alternative. Under the policy rules, language-specific behavior should either offer a choice or clearly justify the locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The prompt template title and usage instruction are written only in Chinese, indicating a fixed language choice for the skill content. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language text in the module docstring and function docstrings is written only in Chinese, with no indication that the skill supports other languages or that this locale restriction is intentional. Under the policy, forcing a specific language without user opt-in or documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes a cloud client for跨境电商 AI 生图用途, implying a purpose-built imaging skill. However, this code constructs a generic /agent/turn request that asks the backend agent to 'directly execute skill {skill_id}' with arbitrary slots and enables broader agent features such as session state and web_fast, which is a more general orchestration capability than a narrow imaging API wrapper.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The constructed user_message and surrounding instructional text are written in Chinese and direct the downstream agent in that language, while multiple error/help messages are also Chinese-only. This imposes a specific language/locale preference without any visible opt-in or alternative, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code posts JSON bodies and bearer-token-authenticated requests to remote endpoints, which can include user or system data from the payload. There is no visible confirmation prompt, print/log disclosure, or explanatory warning comment near the network transmission itself, so callers may not realize data is being sent off-host.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This plain-text prompt template uses Chinese headings and usage instructions, which may impose a specific language/locale on users without opt-in. The file does not indicate that Chinese is optional, configurable, or required for a region-specific purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language headings and usage instructions are written only in Chinese, which imposes a specific language on users without any visible opt-in or justification. This matches the policy category for language or locale constraints that are not optional or clearly documented as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This text file contains user-facing headings and usage guidance in Chinese, while the prompt bodies are in English, and it does not offer any language/locale choice or explain that the skill is intended only for Chinese-speaking users. That can violate a language/locale policy requiring user opt-in or documented justification for a forced language constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file’s instructional text is written entirely in Chinese ('厨具/厨房用品 Prompt 模板', '用法:把 {product} 替换为实际产品英文描述') and does not provide any user opt-in, alternative language, or justification for a Chinese-only locale requirement. This can violate language/locale policy when users are not explicitly given a choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This plain-text skill file contains natural-language content in both Chinese and English, but it does not indicate that language selection is configurable or user-driven. Under the policy rule for language/locale constraints, fixed or implicit language behavior without opt-in can be a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This text template is written as a bilingual/mixed-language prompt asset, combining Chinese headings with English generation instructions throughout. Because the file does not state that mixed Chinese-English output is optional, user-selected, or required for a region-specific workflow, it may violate a language/locale policy that forbids forcing a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file contains user-facing natural language content exclusively in Chinese, and there is no indication that users can opt into another language or that the document is intentionally limited to a Chinese-speaking audience. Under the policy criteria, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file contains natural-language content in both Chinese and English, but it does not state that the mixed-language format is optional or required for a specific audience. Under the language/locale policy rule, forcing or assuming a language format without user opt-in can be a policy concern.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The dependency is specified as requests>=2.31.0 without an upper bound or exact pin, which makes builds non-reproducible and allows future installs to resolve to unexpected versions. In a cloud-connected e-commerce imaging skill that likely sends network requests to external services, this increases supply-chain and stability risk because a later vulnerable or breaking release could be pulled in silently.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding

Because requests is not pinned, it is impossible to verify at review time whether the installed version avoids known advisories affecting some requests releases. This matters more in this skill's context because it appears to interact with remote APIs and possibly credentials, so installing an affected version could expose secrets or weaken transport/request handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The file-level docstring is written entirely in Chinese and provides no indication that language choice is optional or context-specific. Under the policy, forcing a specific language without user opt-in can be a natural-language locale violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.