Back to skill

Security audit

1688 Item One Click

Security checks for vulnerabilities and agentic risk

Overview

This skill can perform legitimate 1688 product edits, but its write scope and credential handling are loose enough that it should be reviewed before use.

Install only if you are comfortable granting this skill authority to change 1688 merchant listings and promotions with the configured AK. Before using it, verify the gateway destination, avoid passing secrets through shared shells or logs, restrict permissions on OpenClaw config files, and require explicit user confirmation before every execute call, especially for discount or promotion changes.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/capabilities/execute/service.py:8
Finding
Product Mutations Can Bypass the Required Pre-Check and User Confirmation Workflow<![CDATA[ ## Vulnerability Details **File Location**: `scripts/capabilities/execute/service.py:8-34`; `scripts/capabilities/execute/cmd.py:17-37` **Vulnerability Type**: Missing enforcement of authorization workflow and operation allowlisting **Risk Level**: High ### Vulnerable Code ```python def execute_action(item_id: str, spi_code: str, spi_params: dict) -> dict: """ Execute the actual modification. Must only be called after before_check succeeds and the user confirms. """ if not item_id: raise ParamError("Product ID (item_id) cannot be empty") if not spi_code: raise ParamError("Operation code (spi_code) cannot be empty") if not spi_params: raise ParamError("Operation parameters (spi_params) cannot be empty") data = api_post( f"/api/{TOOL_CODE_EXECUTE}/1.0.0", { "item_id": item_id, "spi_code": spi_code, "spi_params": spi_params, }, timeout=30, ) if not isinstance(data, dict): raise ServiceError("Invalid response format; try again later") return data ``` The command entry point invokes this function directly: ```python parser.add_argument('--item_id', type=str, required=True, help='Product ID') parser.add_argument('--spi_code', type=str, required=True, help='Operation code') parser.add_argument('--spi_params', type=str, required=True, help='Operation parameters as JSON') args = parser.parse_args() try: spi_params = json.loads(args.spi_params) except json.JSONDecodeError as e: print_error(ValueError(f"spi_params is not valid JSON: {e}")) return try: result = execute_action(args.item_id, args.spi_code, spi_params) ``` ### Technical Analysis The Skill documentation requires every write operation to follow this sequence: 1. Call `before_check`. 2. Verify that the proposed operation is permitted. 3. Display the proposed mutation or agreement to the user. 4. Obtain explicit user confirmation. 5. ...[truncated 2167 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Make `before_check` return a cryptographically protected, short-lived approval token. 2. Bind the token to: - The authenticated account or AK identifier. - Product ID. - Operation code. - A canonical hash of the complete operation parameters. - Expiration time. 3. Require the approval token as an argument to `execute`. 4. Validate the token server-side and reject missing, expired, reused, or mismatched tokens. 5. Mark tokens as single-use after a successful mutation. 6. Require a distinct confirmation step after the pre-check response. Where possible, record confirmation in trusted orchestration state rather than relying exclusively on Agent instructions. 7. Add an explicit allowlist of supported operation codes. 8. Validate each operation with a dedicated schema, including type, format, length, and value constraints. 9. Reject unexpected fields and ensure that the parameters executed are byte-for-byte or canonically equivalent to those approved. 10. Add tests proving that direct execution, changed parameters, replayed approvals, and unsupported operation codes are rejected. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/configure/service.py:26
Finding
Environment-Controlled Gateway URL Can Receive the AK and Gateway Bearer Token<![CDATA[ ## Vulnerability Details **File Location**: `scripts/capabilities/configure/service.py:26-55` **Vulnerability Type**: Unvalidated sensitive-data destination **Risk Level**: Medium ### Vulnerable Code ```python def configure_via_gateway(api_key: str) -> bool: """Write configuration through the OpenClaw Gateway REST API.""" try: import requests except ImportError: return False gateway_url = os.environ.get("OPENCLAW_GATEWAY_URL", "http://localhost:18789") token = os.environ.get("OPENCLAW_GATEWAY_TOKEN", "") payload = { "skills": { "entries": { SKILL_NAME: { "apiKey": api_key } } } } try: headers = {} if token: headers["Authorization"] = f"Bearer {token}" resp = requests.patch(f"{gateway_url}/api/config", headers=headers, json=payload, timeout=5) return resp.ok except Exception: return False ``` ### Technical Analysis `OPENCLAW_GATEWAY_URL` is accepted without validating its scheme, hostname, port, or trust boundary. The resulting endpoint receives: - The full 1688 AK in the JSON request body. - The OpenClaw Gateway bearer token in the `Authorization` header, when configured. If an attacker can influence the process environment, the URL can be changed from the expected loopback Gateway to an attacker-controlled HTTP or HTTPS server. The code will then transmit both credentials to that destination. The default loopback URL is consistent with the declared configuration function, but unrestricted support for arbitrary origins exceeds the minimum privilege necessary for communicating with a local OpenClaw Gateway. An external `http://` URL would additionally transmit credentials without transport encryption. ### Attack Path 1. An attacker or compromised launcher influences the environment used to run the Skill: ```bash ...[truncated 1265 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Restrict Gateway communication to approved loopback destinations such as `127.0.0.1`, `::1`, or a fixed local socket. 2. Prefer a fixed endpoint instead of an environment-controlled URL where deployment requirements permit. 3. If remote Gateways must be supported: - Require HTTPS. - Use an explicit hostname allowlist. - Validate the resolved address to prevent redirects or DNS rebinding to unexpected destinations. - Reject URLs containing user information, fragments, or unexpected paths. 4. Do not send the Gateway bearer token when the destination origin differs from the trusted configured origin. 5. Disable automatic redirects for credential-bearing configuration requests or validate every redirect target. 6. Use mutual TLS or another authenticated local IPC mechanism for sensitive Gateway configuration. 7. Log a safe diagnostic and fail closed when destination validation fails; never proceed to the plaintext file fallback solely because an untrusted URL was rejected. 8. Add tests covering external HTTP URLs, redirects, malformed URLs, IPv6 loopback, and non-loopback resolved addresses. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/configure/service.py:57
Finding
Fallback Configuration Stores the Complete AK Without Enforcing Restrictive File Permissions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/capabilities/configure/service.py:57-84` **Vulnerability Type**: Plaintext sensitive credential storage **Risk Level**: Medium ### Vulnerable Code ```python def configure_via_file(api_key: str) -> bool: """Write directly to openclaw.json as a fallback.""" try: config: dict = {} if CONFIG_PATH.exists(): try: with open(CONFIG_PATH, "r", encoding="utf-8") as f: content = f.read().strip() if content: config = json.loads(content) except json.JSONDecodeError: return False config.setdefault("skills", {}) config["skills"].setdefault("entries", {}) config["skills"]["entries"].setdefault(SKILL_NAME, {}) skill_entry = config["skills"]["entries"][SKILL_NAME] skill_entry["apiKey"] = api_key if "env" in skill_entry and isinstance(skill_entry["env"], dict): skill_entry["env"].pop("ALI_1688_AK", None) if not skill_entry["env"]: del skill_entry["env"] CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True) with open(CONFIG_PATH, "w", encoding="utf-8") as f: json.dump(config, f, ensure_ascii=False, indent=2) return True except Exception: return False ``` The fallback is automatically selected when Gateway configuration fails: ```python write_ok = configure_via_gateway(ak) or configure_via_file(ak) ``` ### Technical Analysis The fallback writes the complete AK into `openclaw.json` as plaintext. The implementation does not explicitly enforce owner-only permissions on either the configuration directory or file. For a newly created file, effective permissions depend on the process umask. For an existing file, opening it with mode `"w"` truncates and rewrites it while retaining the existing file's permissions. Consequently, a pre-existing ...[truncated 1811 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer the OpenClaw secret manager or operating-system credential store instead of placing the AK in general configuration JSON. 2. If file storage is unavoidable: - Create the configuration directory with owner-only permissions. - Create the file with mode `0600`. - Verify ownership and permissions before every read or write. - Refuse to write if the target has unexpected ownership or unsafe permissions. 3. Write through an owner-only temporary file in the same directory, flush and synchronize it, then atomically replace the destination. 4. Preserve unrelated configuration without exposing it through temporary files or broad permissions. 5. Clearly notify the user when plaintext fallback storage is used rather than reporting only that the AK was saved. 6. Consider requiring explicit opt-in before using plaintext fallback. 7. Avoid retaining legacy duplicate credential fields. 8. Add automated tests for permissive umasks, existing world-readable files, interrupted writes, and incorrect ownership. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (44)

Tainted flow: 'gateway_url' from os.environ.get (line 33, credential/environment) → requests.patch (network output)

Critical
Category
Data Flow
Content
headers = {}
        if token:
            headers["Authorization"] = f"Bearer {token}"
        resp = requests.patch(f"{gateway_url}/api/config",
                              headers=headers, json=payload, timeout=5)
        return resp.ok
    except Exception:
Confidence
91% confidence
Finding
The service takes OPENCLAW_GATEWAY_URL directly from the environment and sends the supplied API key to that endpoint, optionally with a bearer token. If an attacker can influence environment variables or deployment configuration, they can redirect credential writes to an attacker-controlled server, causing secret exfiltration; the default use of plain HTTP also increases exposure.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill is presented as a product-editing tool but also includes API key configuration, secret handling, and network gateway updates. Mixing credential-management behavior into a business-operation skill without prominent disclosure increases the risk of credential misuse, accidental secret exposure, and over-privileged execution.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill is presented as a product-editing tool but also includes API key configuration, secret handling, and network gateway updates. Mixing credential-management behavior into a business-operation skill without prominent disclosure increases the risk of credential misuse, accidental secret exposure, and over-privileged execution.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill is presented as a product-editing tool but also includes API key configuration, secret handling, and network gateway updates. Mixing credential-management behavior into a business-operation skill without prominent disclosure increases the risk of credential misuse, accidental secret exposure, and over-privileged execution.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The skill is presented as a product-editing tool but also includes API key configuration, secret handling, and network gateway updates. Mixing credential-management behavior into a business-operation skill without prominent disclosure increases the risk of credential misuse, accidental secret exposure, and over-privileged execution.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill is presented as a product-editing tool but also includes API key configuration, secret handling, and network gateway updates. Mixing credential-management behavior into a business-operation skill without prominent disclosure increases the risk of credential misuse, accidental secret exposure, and over-privileged execution.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill is presented as a product-editing tool but also includes API key configuration, secret handling, and network gateway updates. Mixing credential-management behavior into a business-operation skill without prominent disclosure increases the risk of credential misuse, accidental secret exposure, and over-privileged execution.

Credential Access

High
Category
Privilege Escalation
Content
职责:每次 CLI 命令执行时,向 skill 网关上报一次调用记录,用于统计 skill 调用次数。
上报失败不影响主流程,静默处理。

环境变量(从项目根目录 .env 读取):
    SKILL_NAME     skill 名称,默认 1688-item-one-click
    SKILL_VERSION  skill 版本,默认 1.0.0
    SKILL_CHANNEL  发布渠道,默认 clawhub
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
职责:每次 CLI 命令执行时,向 skill 网关上报一次调用记录,用于统计 skill 调用次数。
上报失败不影响主流程,静默处理。

环境变量(从项目根目录 .env 读取):
    SKILL_NAME     skill 名称,默认 1688-item-one-click
    SKILL_VERSION  skill 版本,默认 1.0.0
    SKILL_CHANNEL  发布渠道,默认 clawhub
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
职责:每次 CLI 命令执行时,向 skill 网关上报一次调用记录,用于统计 skill 调用次数。
上报失败不影响主流程,静默处理。

环境变量(从项目根目录 .env 读取):
    SKILL_NAME     skill 名称,默认 1688-item-one-click
    SKILL_VERSION  skill 版本,默认 1.0.0
    SKILL_CHANNEL  发布渠道,默认 clawhub
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
def _load_env_file() -> None:
    """解析项目根目录的 .env 文件,将变量注入 os.environ(已有环境变量不覆盖)。"""
    env_path = _ROOT_DIR / ".env"
    if not env_path.exists():
        return
    with open(env_path, encoding="utf-8") as f:
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
This file implements access-key configuration and secret-handling behavior that is unrelated to the declared purpose of the skill, which is one-click 1688 item editing. A skill that silently introduces credential configuration expands privilege and trust boundaries, and can be used to capture, persist, or manipulate sensitive credentials under the guise of an unrelated business function.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The executable logic performs AK validation, checking, and persistence rather than product title/image/member-post modification as advertised. This mismatch is dangerous because users or platforms may grant execution based on the manifest's benign item-editing description, while the actual code handles secrets and configuration state, enabling covert collection or misuse of credentials.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill declares no explicit tool scope even though it documents capabilities that involve environment access, local file reads/writes, and network calls. Without a least-privilege declaration, an agent may grant broader access than users expect, increasing the blast radius if the skill is misused or compromised.

Vague Triggers

Medium
Confidence
88% confidence
Finding
Broad trigger phrases such as generic 'one-click modify' or 'product modify' can cause the skill to activate on ordinary conversational requests. Because this skill supports write operations, accidental invocation raises the risk of unintended modification attempts and user confusion.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The documentation expands the skill to include discount-setting, which is outside the declared manifest scope. Scope expansion matters because agents or users may invoke a write-capability that was not clearly authorized or reviewed, leading to unintended business-impacting changes.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
Presenting discount-setting as a valid operation while other sections define a narrower scope creates contradictory operator guidance. In an agent setting, contradictory documentation can cause unauthorized or unintended write actions against product listings and promotions.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill documents automatic usage reporting to an external endpoint but does not prominently disclose this behavior in the main description or consent flow. Underspecified telemetry is dangerous because it can leak operational metadata and surprise users who believed they were only modifying product data.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The documented `before_check` capability includes `spi_hsf_offer_promotion_dszk` for setting limited-time discounts, but the skill metadata only advertises title changes, main image changes, and member-post publishing. This creates a scope-expansion/integrity risk: an agent or user relying on the manifest may unknowingly invoke a price-affecting operation, leading to unauthorized commercial changes and financial impact.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill exposes an AccessKey configuration capability that is outside the manifest’s stated end-user purpose of one-click product editing and posting updates. Hidden or undocumented credential-handling functionality expands the trust boundary, can surprise users or orchestrators, and may enable unauthorized access setup if invoked inappropriately.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The documentation instructs users to pass an AccessKey directly via CLI without an explicit warning that the value is sensitive. This can lead to credential exposure through shell history, process listings, logs, screenshots, or copied command transcripts, making compromise of downstream authenticated operations more likely.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
The execute capability documents and enables a write operation for setting limited-time discounts, but the skill metadata only declares title changes, main image changes, and posting member updates. This scope mismatch is dangerous because an agent or user may invoke an undeclared pricing/promotion action that directly alters commercial terms, bypassing user expectations, approval boundaries, or policy review tied to the manifest.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
The operation table exposes a promotion/pricing action (`spi_hsf_offer_promotion_dszk`) beyond the stated skill capabilities, effectively expanding the reachable write surface without transparent disclosure. In this skill context, changing discounts is more sensitive than cosmetic edits like title or image updates because it can immediately affect revenue, compliance, and customer-facing pricing behavior.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The CLI unconditionally reports usage telemetry after every command via `_tracker.report_skill_usage()` and this file provides no user-facing disclosure, consent flow, or opt-out. In a skill that performs potentially sensitive merchant operations, silent telemetry can expose operational metadata such as command usage patterns, identifiers, or execution context, creating privacy and compliance risk even if the main command succeeds.

Natural-Language Policy Violations

Medium
Confidence
85% confidence
Finding
The module-level docstring is written entirely in Chinese and describes the standardized output shape, while all exception messages are also hard-coded in Chinese elsewhere in the file. This indicates a fixed language choice without any visible user opt-in or language-selection mechanism, which can violate language/locale policy requirements.

Static analysis

No suspicious patterns detected.