Back to skill

Security audit

1688 Item Select

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly aligned with 1688 product selection, but its setup path stores and forwards a merchant Access Key with weak disclosure and safeguards.

Review before installing. Use a least-privilege 1688 AK, verify OPENCLAW_GATEWAY_URL before running configure, and protect or avoid plaintext openclaw.json storage where possible. Expect signed requests and usage telemetry to be sent to the 1688/OpenClaw gateway. No artifact-backed evidence of destructive behavior, backdoors, or unrelated exfiltration was found.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/configure/service.py:42
Finding
Access Key Stored in Plaintext Without Enforced File Permissions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/capabilities/configure/service.py:42-64` **Vulnerability Type**: Plaintext sensitive-data storage with insufficient permission enforcement **Risk Level**: Medium ### Vulnerable Code ```python def configure_via_file(api_key: str) -> bool: 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 ``` ### Technical Analysis When gateway-based configuration is unavailable, the Skill falls back to writing the merchant Access Key to `openclaw.json`. The credential is stored as plaintext in the `apiKey` property. The code creates the parent directory and writes the file using ordinary Python file operations, but it does not set or verify restrictive permissions. Consequently, the effective access controls depend on the process umask and any pre-existing directory or file permissions. If those permissions allow access by other local users or processes, the credential can be disclosed. This exceeds secure minimu ...[truncated 1579 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer an operating-system credential store or the OpenClaw secret-management mechanism instead of plaintext JSON storage. 2. If file fallback remains necessary: - Create the configuration directory with mode `0700`. - Create the configuration file atomically with mode `0600`. - Verify and correct permissions on pre-existing files before writing. - Reject symbolic links and unexpected non-regular files. 3. Write to a securely created temporary file in the same directory, apply restrictive permissions, flush it, and atomically replace the destination. 4. Avoid silently falling back to insecure storage. Inform the user when secure gateway storage is unavailable and require explicit consent before plaintext file storage. 5. Document the credential location, protection model, and rotation procedure. 6. Recommend immediate AK rotation if unauthorized filesystem access is suspected. ]]>

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding
Unpinned HTTP Dependency Creates Non-Reproducible Supply-Chain Exposure<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1` **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Low ### Vulnerable Code ```text requests ``` ### Technical Analysis The project declares `requests` without a version constraint, lockfile, or package hash. Each installation can therefore resolve to a different release from the configured package index. The affected package is security-sensitive in this project: it handles signed requests, authentication headers, configuration updates, telemetry, and responses from external services. An unreviewed, compromised, or unexpectedly incompatible release would execute in the Skill's Python process and inherit access to its environment, configuration files, merchant AK, and network connectivity. An unpinned dependency is not proof that the current `requests` package is malicious. The vulnerability is the absence of reproducible dependency resolution and integrity verification, which expands the supply-chain trust boundary beyond the audited source tree. ### Attack Path 1. The Skill is installed or rebuilt in an environment that resolves dependencies dynamically. 2. The package index, index configuration, dependency-resolution path, or a future package release is compromised. 3. Installation resolves `requests` to an unreviewed malicious version because no exact version or hash is required. 4. The malicious package executes during import or when HTTP functionality is invoked. 5. It reads process environment variables or the OpenClaw configuration containing the AK. 6. It can transmit those values using the Skill process's network access or tamper with authenticated requests and responses. This path depends on compromise or manipulation of the dependency supply chain; no malicious dependency payload was present in the audited project itself. ### Impact Assessment Malicious dependency code would execute with the same operating-system privileges as the Skill process ...[truncated 450 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `requests` to a specific reviewed version rather than allowing unrestricted resolution. 2. Use a lockfile or hash-checked requirements file, for example with `--require-hashes`. 3. Pin and hash transitive dependencies as well as the direct dependency. 4. Install packages only from an explicitly trusted HTTPS package index. 5. Add automated dependency vulnerability scanning and a controlled update process. 6. Re-review and test dependency updates before changing the lockfile. ]]>
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 (54)

Tainted flow: 'gateway_url' from os.environ.get (line 30, 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:
        return False
Confidence
96% confidence
Finding
The code sends the provided API key to a URL taken directly from the OPENCLAW_GATEWAY_URL environment variable, defaulting to plain HTTP. If that variable is influenced by an attacker or misconfigured, the secret can be exfiltrated to an arbitrary host, and use of HTTP permits interception in transit. In this skill context, handling credentials is already outside the declared item-selection purpose, which makes the behavior more suspicious and increases risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description omits that it includes AK configuration, validation, and persistence behavior, which means it processes and stores sensitive credentials beyond the advertised recommendation/search function. Undisclosed credential-handling logic is dangerous because users may invoke the skill expecting analytics while it also writes secrets to local configuration and performs authentication workflows.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description omits that it includes AK configuration, validation, and persistence behavior, which means it processes and stores sensitive credentials beyond the advertised recommendation/search function. Undisclosed credential-handling logic is dangerous because users may invoke the skill expecting analytics while it also writes secrets to local configuration and performs authentication workflows.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description omits that it includes AK configuration, validation, and persistence behavior, which means it processes and stores sensitive credentials beyond the advertised recommendation/search function. Undisclosed credential-handling logic is dangerous because users may invoke the skill expecting analytics while it also writes secrets to local configuration and performs authentication workflows.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill description omits that it includes AK configuration, validation, and persistence behavior, which means it processes and stores sensitive credentials beyond the advertised recommendation/search function. Undisclosed credential-handling logic is dangerous because users may invoke the skill expecting analytics while it also writes secrets to local configuration and performs authentication workflows.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The skill description omits that it includes AK configuration, validation, and persistence behavior, which means it processes and stores sensitive credentials beyond the advertised recommendation/search function. Undisclosed credential-handling logic is dangerous because users may invoke the skill expecting analytics while it also writes secrets to local configuration and performs authentication workflows.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill description omits that it includes AK configuration, validation, and persistence behavior, which means it processes and stores sensitive credentials beyond the advertised recommendation/search function. Undisclosed credential-handling logic is dangerous because users may invoke the skill expecting analytics while it also writes secrets to local configuration and performs authentication workflows.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill description omits that it includes AK configuration, validation, and persistence behavior, which means it processes and stores sensitive credentials beyond the advertised recommendation/search function. Undisclosed credential-handling logic is dangerous because users may invoke the skill expecting analytics while it also writes secrets to local configuration and performs authentication workflows.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill description omits that it includes AK configuration, validation, and persistence behavior, which means it processes and stores sensitive credentials beyond the advertised recommendation/search function. Undisclosed credential-handling logic is dangerous because users may invoke the skill expecting analytics while it also writes secrets to local configuration and performs authentication workflows.

Credential Access

High
Category
Privilege Escalation
Content
_ROOT_DIR = Path(__file__).parent.parent

def _load_env_file() -> None:
    """解析项目根目录的 .env 文件,将变量注入 os.environ(已有环境变量不覆盖)。"""
    env_path = _ROOT_DIR / ".env"
    if not env_path.exists():
        return
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
_ROOT_DIR = Path(__file__).parent.parent

def _load_env_file() -> None:
    """解析项目根目录的 .env 文件,将变量注入 os.environ(已有环境变量不覆盖)。"""
    env_path = _ROOT_DIR / ".env"
    if not env_path.exists():
        return
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.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The file implements AK credential configuration logic, which is materially unrelated to the declared skill purpose of 1688 item selection, scoring, and search. This capability expands the trust boundary by collecting and persisting secrets, making the skill more dangerous because users invoking a product-selection skill would not reasonably expect credential-management behavior.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
This file implements API-key configuration, gateway updates, and local secret persistence even though the skill is described as a product-selection/search capability. That mismatch is a supply-chain risk because the skill possesses hidden credential-management functionality not justified by its manifest, expanding the trust boundary and creating opportunity for secret collection or misuse.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill declares executable capabilities that imply environment access, file reads/writes, and network use, but it does not scope or constrain those capabilities with an explicit permissions/allowed-tools policy. In this skill’s context, that matters because it handles an Access Key, reads local files like .env/references, and sends data to an external gateway, so the absence of explicit tool boundaries increases the chance of overbroad execution or unintended data exposure.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger list includes broad phrases like 选品, 推荐商品, and 搜索商品, which are common in ordinary conversation and can cause accidental invocation. In this skill’s context, accidental runs matter because invocation may lead to external data access, telemetry submission, and credential-dependent operations against shop data.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The description around command usage does not clearly warn users that execution requires handling a sensitive Access Key and that command runs report data to an external gateway. Insufficient upfront disclosure is dangerous because users may unknowingly expose credentials or business metadata under the assumption the skill is a simple local scoring helper.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The security declaration marks configure as 'read-only' even though the command sets or updates an Access Key, which is a state-changing write operation involving sensitive material. Mislabeling a credential-writing command as harmless can bypass user caution and approval expectations, increasing the risk of unsafe secret handling or unintended persistence.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The CLI unconditionally reports usage telemetry after every command via `_tracker.report_skill_usage()` and this file does not disclose that behavior or provide consent/opt-out controls. In a merchant analytics skill, command usage may reveal sensitive business interests, operational patterns, or query intent even if command execution succeeds, creating a privacy and transparency risk.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The natural-language content of the skill file is entirely in Chinese, including usage instructions, output descriptions, and error guidance. Under the stated policy, forcing a specific language without user opt-in or an explicit documented justification constitutes a language/locale policy violation.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The file presents all user-facing instructions, parameters, and warnings exclusively in Chinese. Under the policy rule for language or locale constraints, this effectively forces a specific language without user opt-in, and there is no indication that the skill is intentionally restricted to a Chinese-speaking or region-specific audience.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file title and all instructional content are written in Chinese, with only a brief English gloss in the title, and there is no statement that another language may be used. Under the policy, forcing a specific language without opt-in is a natural-language locale violation unless clearly justified or optional.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
The module falls back to reading API credentials from a local gateway configuration file, expanding the credential trust boundary beyond the intended environment-variable injection path. This increases the chance that the skill can access secrets from host-local configuration without explicit user intent, and in a plugin/agent context that is a meaningful secret-handling weakness even if no exfiltration is shown in this file.

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
The file contains user- or maintainer-facing natural-language text only in Chinese, such as the module docstring and comments, with no indication that the language choice is optional or region-specific. Under the language/locale policy, forcing a specific language without opt-in can be a policy concern.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This file contains user-facing natural-language text in Chinese in the module docstring and default exception messages. Under the policy, forcing a specific language without user opt-in can be a locale/language policy violation, and there is no indication here that the skill is intentionally region-specific or that users can choose another language.

Static analysis

No suspicious patterns detected.