Back to skill

Security audit

1688 Customer Opportunity

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches a 1688 customer-operations tool, but its Access Key setup can expose credentials through unsafe command-line, file, and gateway handling.

Review this skill before installing. It can read customer and buyer-operation data and can activate a Wangwang marketing plan after confirmation. Do not paste production Access Keys into chat or command lines unless you accept that exposure risk; prefer a platform-managed secret flow. Only use the gateway configuration path when OPENCLAW_GATEWAY_URL is trusted and local or otherwise explicitly approved, and check permissions on any openclaw.json file that stores credentials.

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

Warning
Location
scripts/capabilities/configure/cmd.py:39
Finding
Access Key Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/capabilities/configure/cmd.py:39-45` **Additional Locations**: `SKILL.md:266`, `SKILL.md:318`, `references/capabilities/configure.md:11-24` **Vulnerability Type**: Sensitive credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```python ak = sys.argv[1].strip() is_valid, error_msg = validate_ak(ak) if not is_valid: print_output(False, f"❌ {error_msg}", {"configured": False}) return write_ok = configure_via_gateway(ak) or configure_via_file(ak) ``` The documented invocation explicitly places the credential in the command: ```bash python {baseDir}/cli.py configure YOUR_AK_HERE ``` ### Technical Analysis The complete Access Key is accepted as a command-line argument through `sys.argv`. Command-line secrets can be exposed through: - Shell history files. - Process listings such as `ps` while the command is running. - Terminal recordings and session transcripts. - Agent tool-call logs or command audit logs. - Process-monitoring and endpoint-management software. - Error reports that capture command invocations. The command masks the key in its eventual output, but masking occurs only after the complete credential has already passed through these exposure surfaces. The credential is security-sensitive because `_auth.py` splits it into an Access Key ID and Access Key secret used to generate authenticated HMAC signatures. ### Attack Path 1. A merchant follows the documented command and supplies the complete Access Key as an argument. 2. The shell, agent runtime, operating system, or monitoring infrastructure records the command line. 3. A local user, process, administrator, or log reader obtains the recorded argument. 4. The exposed value is split into its Access Key ID and secret using the same format implemented by `_auth.py`. 5. The attacker uses the recovered credential to sign requests to the 1688 Skill gateway. ### Impact Assessment Successful ...[truncated 517 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace command-line credential input with masked interactive input: ```python from getpass import getpass api_key = getpass("Enter the Access Key: ").strip() ``` 2. For noninteractive use, accept the credential through standard input or a dedicated secret-provider interface rather than a process argument. 3. Remove documentation examples that place credentials directly in command text. 4. Ensure agent-generated tool calls never include credentials in visible execution logs or conversational output. 5. Avoid exposing credentials through environment variables when the runtime makes process environments broadly observable. 6. Add tests verifying that configuration commands do not place the Access Key in `sys.argv`, output, exceptions, or logs. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/capabilities/configure/service.py:28
Finding
Unrestricted Gateway URL Can Receive the Access Key and Gateway Bearer Token<![CDATA[ ## Vulnerability Details **File Location**: `scripts/capabilities/configure/service.py:28-56` **Vulnerability Type**: Credential forwarding to an unvalidated destination **Risk Level**: High ### Vulnerable Code ```python def configure_via_gateway(api_key: str) -> bool: """Through OpenClaw Gateway REST API write configuration""" 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 consumed without validating its scheme, hostname, port, path, or locality. The resulting request contains: - The merchant Access Key in the JSON body. - The OpenClaw Gateway bearer token in the `Authorization` header, when configured. Although the default destination is a local Gateway, the code accepts any environment-provided URL. A poisoned or incorrectly configured environment can redirect the request to an attacker-controlled server. The implementation also accepts cleartext HTTP for non-loopback destinations, allowing interception of both credentials in transit. This behavior exceeds the minimum privilege needed for local configuration because a local configuration function should not forward authentication material to arbitrary remote hosts. ### Attack Path 1. An attacker-controlled launcher, wrapper, configuration, or compromised runtime sets: ```bash OPENCLAW_G ...[truncated 1332 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Restrict the default Gateway destination to loopback addresses: - `localhost` - `127.0.0.1` - `::1` 2. Parse the URL with `urllib.parse.urlparse` and reject: - Unexpected schemes. - Non-loopback hosts unless explicitly allowlisted. - Embedded user information. - Fragments or unexpected paths. - Unapproved ports. 3. Require HTTPS with normal certificate validation for any explicitly authorized remote Gateway. 4. Do not send the Gateway bearer token to a host unless that exact origin has been validated and approved. 5. Consider ignoring `OPENCLAW_GATEWAY_URL` in untrusted execution contexts or requiring it to come from protected platform configuration. 6. Avoid transmitting the merchant Access Key and Gateway bearer token in the same request whenever the architecture permits. 7. Add tests proving that attacker-controlled, non-loopback, and cleartext remote URLs are rejected before any request is sent. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/configure/service.py:59
Finding
Plaintext Access Key Stored Without Explicit Permission Hardening<![CDATA[ ## Vulnerability Details **File Location**: `scripts/capabilities/configure/service.py:59-89` **Related Location**: `scripts/_const.py:12-16` **Vulnerability Type**: Insecure plaintext credential storage **Risk Level**: Medium ### Vulnerable Code ```python def configure_via_file(api_key: str) -> bool: """Directly write 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 destination is constructed as follows: ```python OPENCLAW_CONFIG_PATH: Path = Path( os.environ.get("OPENCLAW_CONFIG_DIR", Path.home() / ".openclaw") ) / "openclaw.json" ``` ### Technical Analysis When Gateway-based configuration fails, the fallback writes the complete Access Key in plaintext to `openclaw.json`. The implementation does not: - Create the configuration directory with an explicit `0700` mode. - Create the credential-bearing file with an explicit `0600` mode. - Check or repair permissions on an existing file. - Use a pro ...[truncated 1638 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer the OpenClaw secret store, an operating-system keychain, or another dedicated credential manager instead of plaintext JSON. 2. If a file fallback is unavoidable: - Create the parent directory with mode `0700`. - Create temporary and destination files with mode `0600`. - Verify and repair permissions on existing files. - Refuse to use files owned by another user. - Reject symbolic links and other unsafe file types. 3. Use atomic, protected writes. For example: - Create a temporary file in the same directory using exclusive creation. - Apply mode `0600` before writing. - Flush and synchronize the data. - Atomically replace the destination. 4. Warn the user before falling back from Gateway storage to plaintext file storage rather than performing the fallback silently. 5. Add automated tests under permissive umask settings to verify that the resulting directory and file remain private. ]]>
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (66)

Tainted flow: 'gateway_url' from os.environ.get (line 35, 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
90% confidence
Finding
The code takes OPENCLAW_GATEWAY_URL directly from the environment and sends the supplied API key to that URL with no allowlist, scheme validation, or host verification. If an attacker can influence the environment, they can redirect credential-bearing requests to an attacker-controlled endpoint and exfiltrate the API key and optional bearer token.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.

Ae1

High
Category
analysis-evasion
Content
CLI 入口文件:`{baseDir}/cli.py`(`{baseDir}` = skill 根目录,含 `SKILL.md` 和 `cli.py`)。**禁止** `{baseDir}/scripts/cli.py`——`cli.py` 不在 `scripts/` 子目录。
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Natural-Language Policy Violations

High
Confidence
98% confidence
Finding
该处明确要求所有用户可见输出必须100%使用中文,并禁止任何英文表述,这是明显的语言/locale 强制策略。文档中未说明这是仅适用于特定地区合规场景,也未向用户提供语言选择或显式同意机制,因此构成自然语言政策违规。

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The configuration guide is for DingTalk message-sending AK setup, which is unrelated to the declared 1688 customer-operation skill. This capability mismatch is dangerous because it can mislead users into granting credentials for an unstated channel, expanding the skill’s effective privileges and creating a path for unauthorized messaging or data exfiltration under a misleading cover story.

Missing User Warnings

High
Confidence
99% confidence
Finding
The guide tells users to paste an Access Key into chat and then pass it as a command-line argument, exposing the secret in conversation history, logs, shell history, and process listings. This creates a direct credential leakage risk that could allow anyone with access to transcripts or host telemetry to reuse the key for unauthorized API actions.

Credential Access

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

环境变量(从项目根目录 .env 读取):
    SKILL_NAME     skill 名称,默认 1688-open-skill-template
    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-open-skill-template
    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-open-skill-template
    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.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
This skill is described as a customer follow-up and operations tool, but the file implements credential discovery and storage, including reading existing secrets from environment/config and writing API keys to persistent config. That mismatch is dangerous because users or calling systems may grant or execute the skill under assumptions unrelated to secret handling, enabling unnecessary access to credentials and increasing the blast radius if the skill is abused or compromised.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill declares broad operational behavior and references capabilities that imply file, environment, and network access, but it does not define an explicit tool/permission scope. Without least-privilege restrictions, a host agent may grant more access than is necessary, increasing the blast radius if the skill logic is abused or compromised.

Vague Triggers

Medium
Confidence
94% confidence
Finding
Overly broad trigger phrases can cause the skill to activate in conversations that were not intended to invoke customer-data operations. In this skill context, accidental triggering is more dangerous because the documented flows can query buyer details, profiles, and recommendations, increasing the risk of unnecessary data access or unintended outbound actions.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The 'key customer direct query' trigger set contains broad business phrases that may match ordinary discussion rather than an explicit request to run the skill. Because this skill can pivot into customer segmentation and follow-up analysis, accidental activation can expose sensitive buyer insights without clear user intent.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The workflow instructs the agent to use `list_customer_details` and `customer_crowd_analysis` even though those capabilities are not consistently declared in the skill's stated scope. This kind of scope drift can bypass reviewer expectations and cause the agent to invoke extra data-access paths that were not approved as part of the advertised functionality.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
Usage tracking is triggered after every command with no visible notice, consent flow, or configuration gate in this file. In a customer-operations skill that may process buyer identities and business activity, hidden telemetry increases privacy risk and could leak commercially sensitive usage context if the tracker captures command names, timing, or arguments.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file is entirely written as an operational instruction in Chinese, beginning with the core activation description, and it does not offer any language choice or note that the skill is region/language-specific. Under the policy criteria, forcing a specific language without user opt-in is a natural-language locale violation.

Static analysis

No suspicious patterns detected.