Back to skill

Security audit

1688 Bp Inquiry Evaluate

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to provide the stated 1688 inquiry reports, but it handles access keys and configuration in ways users should review carefully before installing.

Review this skill before installing. It likely performs the advertised 1688 reporting, but only use it where the AK is intended to be shared with the 1688-shopkeeper configuration, the OpenClaw gateway URL is trusted and local, and report recipients are allowed to see buyer conversation details and salesperson/inquiry links. Avoid pasting production AKs into chat or shell commands unless your environment protects transcripts, history, and process logs.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/capabilities/configure/service.py:32
Finding
Plaintext Access Key Can Be Transmitted to an Environment-Controlled Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `scripts/capabilities/configure/service.py:32-58` **Vulnerability Type**: Unrestricted credential transmission endpoint **Risk Level**: High ### Vulnerable Code ```python def configure_via_gateway(api_key: str) -> bool: 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 The configuration function sends the complete plaintext access key in an HTTP request body. The destination is taken directly from the `OPENCLAW_GATEWAY_URL` environment variable without validating its scheme, host, port, or loopback status. Although the default destination is a local gateway, any process or execution environment capable of influencing this environment variable can redirect the request to an arbitrary remote endpoint. The implementation does not require HTTPS for remote destinations and does not verify that the endpoint represents the trusted OpenClaw gateway. This exceeds least-privilege requirements because configuring a local secret does not require permitting transmission to arbitrary hosts. ### Attack Path 1. An attacker, compromised launcher, malicious wrapper, or poisoned execution environment sets `OPENCLAW_GATEWAY_URL` to an attacker-controlled URL. 2. A user invokes `cli.py configure` with a valid ...[truncated 950 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not accept an unrestricted gateway URL for credential configuration. 2. Permit only explicit loopback destinations such as `127.0.0.1`, `::1`, or a securely authenticated Unix-domain socket. 3. If remote gateways are required, enforce HTTPS, certificate verification, and an allowlist of trusted hostnames. 4. Require gateway authentication rather than making `OPENCLAW_GATEWAY_TOKEN` optional. 5. Reject URLs containing user information, redirects, unexpected paths, fragments, or nonapproved ports. 6. Disable redirects for the credential-bearing request. 7. Prefer passing a reference to a secret-manager entry instead of transmitting the raw AK. 8. Clearly report configuration failure without silently falling back after contacting an untrusted destination. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/configure/service.py:62
Finding
Access Key Is Exposed Through Command-Line Arguments and Potentially Insecure File Permissions<![CDATA[ ## Vulnerability Details **File Locations**: - `references/capabilities/configure.md:15-23` - `scripts/capabilities/configure/cmd.py:37-45` - `scripts/capabilities/configure/service.py:62-90` **Vulnerability Type**: Insecure local secret handling **Risk Level**: Medium ### Vulnerable Code The documented interface places the secret directly in a command argument: ```bash python3 {baseDir}/cli.py configure YOUR_AK_HERE ``` The command then reads the secret from `sys.argv`: ```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 fallback stores it as plaintext without explicitly enforcing restrictive file permissions: ```python 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) ``` ### Technical Analysis Secrets passed as command-line arguments can be exposed through shell history, process inspection utilities, process monitoring, audit logs, terminal recording, and orchestration telemetry. If gateway configuration fails, the fallback writes the AK in plaintext to `openclaw.json`. The code does not create the file with mode `0600`, verify existing file ownership, reject symbolic links, or atomically replace the target. Permissions therefore depend on the process umask and preexisting filesystem state. The direct write also creates a time window in which the configuration f ...[truncated 1333 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the AK from command-line arguments. 2. Read it from hidden interactive input using `getpass`, a protected file descriptor, or a supported secret-manager API. 3. Warn users not to place credentials in shell history or chat-visible command examples. 4. Create the configuration file with mode `0600` and verify that it is owned by the current user. 5. Reject symbolic links and nonregular destination files. 6. Write to a securely created temporary file in the same directory, set its permissions, flush and synchronize it, and then replace the destination atomically. 7. Preserve or strengthen secure permissions when updating an existing file. 8. Prefer storing a secret reference or encrypted value instead of the plaintext AK. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/capabilities/configure/service.py:10
Finding
Skill Reads and Overwrites Another Skill's Credential Namespace<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/capabilities/configure/service.py:10-13,73-85` - `scripts/_auth.py:46-55` **Vulnerability Type**: Cross-Skill credential and configuration access **Risk Level**: Medium ### Vulnerable Code The audited Skill is declared as `1688-bp-inquiry-evaluate`, but configuration is written under another Skill name: ```python from _const import OPENCLAW_CONFIG_PATH as CONFIG_PATH SKILL_NAME = "1688-shopkeeper" ``` ```python 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"] ``` Authentication also reads from that other namespace: ```python def _get_ak_raw_from_config() -> Optional[str]: if not OPENCLAW_CONFIG_PATH.exists(): return None try: with open(OPENCLAW_CONFIG_PATH, "r", encoding="utf-8") as f: config = json.load(f) entries = config.get("skills", {}).get("entries", {}) skill = entries.get("1688-shopkeeper", {}) ak = skill.get("apiKey") or skill.get( "env", {} ).get("ALI_1688_AK", "") return ak if ak else None except Exception: return None ``` ### Technical Analysis The Skill crosses its declared configuration boundary by consuming and modifying the `1688-shopkeeper` entry. Running this Skill's configuration command can overwrite a credential belonging to another Skill and remove that entry's legacy environment configuration. No explicit shared-credential contract or namespace validation is present in the audited implementation. This creates credential confusion and violates least privilege: the evaluation Skill should only need access to its own secret entry. # ...[truncated 1225 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Store and retrieve the credential under a dedicated `1688-bp-inquiry-evaluate` configuration entry. 2. Do not delete or modify fields belonging to `1688-shopkeeper`. 3. If credential sharing is intentional, define it through an explicit shared credential provider rather than aliasing another Skill's namespace. 4. Require clear user consent before linking this Skill to a shared credential. 5. Validate the expected account or credential identity before use. 6. Apply configuration-layer access controls so a Skill can read and write only its own namespace. 7. Add migration logic that copies a legacy credential only after confirmation and never silently overwrites the source entry. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/bp_inquiry_evaluate_summary/cmd.py:96
Finding
Generated Reports Expose Prohibited Salesperson and Inquiry Identifiers<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/capabilities/bp_inquiry_evaluate_summary/cmd.py:96-101,118-120,168-171,197-205` - `scripts/capabilities/bp_inquiry_evaluate_sales_detail/cmd.py:116-120,159-162` **Vulnerability Type**: Sensitive business identifier exposure **Risk Level**: Medium ### Vulnerable Code The summary renderer places the salesperson identifier into report URLs: ```python seller_id = detail.get("saleIdentityId", "") report_url = ( "https://air.1688.com/app/bp-boot/" "a2a-team-newton/index.html#/assessment-detail" f"?startAt={start_at}&endAt={end_at}" f"&sellerUserId={seller_id}" ) report_link = f"[Click to view the complete report]({report_url})" ``` It also embeds salesperson and inquiry identifiers into detail URLs: ```python inquiry_id = inq.get("inquiryId", "") if inquiry_id: detail_url = ( "https://air.1688.com/app/bp-boot/" "a2a-team-newton/index.html#/inquiry-detail" f"?startAt={start_at}&endAt={end_at}" f"&sellerUserId={sale_identity_id}" f"&inquiryId={inquiry_id}" ) lines.append( f"| [View complete inquiry details]({detail_url}) " ) ``` The summary command additionally returns raw salesperson identifiers in structured output: ```python def extract_seller_list(result: dict) -> list: evaluate_details = result.get("evaluateDetails", []) return [ { "saleIdentityId": detail.get("saleIdentityId", ""), "saleIdentityName": detail.get("saleIdentityName", "") } for detail in evaluate_details ] ``` The detail renderer repeats the URL exposure: ```python report_url = ( "https://air.1688.com/app/bp-boot/" "a2a-team-newton/index.html#/assessment-detail" f"?startAt={start_at}&endAt={end_at}" f"&sellerUserId={sale_identity_id}" ) ``` ```python inquiry_id = detail.get("inquiryId", "") if inquiry_id: detail_url = ( "https://air.1688.com/app/bp-boot/" ...[truncated 2122 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `saleIdentityId`, `sellerUserId`, and `inquiryId` from user-visible Markdown and structured output. 2. Generate opaque, short-lived report tokens on the trusted backend. 3. Use backend-generated links that contain random, expiring references rather than stable internal identifiers. 4. Enforce authorization on every report and inquiry endpoint regardless of identifier secrecy. 5. Avoid placing sensitive values in URL query strings or fragments because URLs are frequently logged. 6. Return only the salesperson display name and nonidentifying report fields to the Agent. 7. Add automated tests that fail if prohibited identifier names or values appear in Markdown or JSON output. 8. Review existing transcripts and logs for exposed identifiers and apply appropriate retention or redaction controls. ]]>
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 36, 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
97% confidence
Finding
The code takes OPENCLAW_GATEWAY_URL directly from the environment and uses it to send a PATCH request containing the API key and optional bearer token. If an attacker can influence the environment, they can redirect credentials to an arbitrary endpoint, and the default also uses plain HTTP, increasing interception and exfiltration risk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The documented behavior includes AK/API-key validation, local gateway writes, direct config-file reads/writes, and credential-state inspection, none of which are disclosed by the stated assessment purpose. Combining secret handling with file/network side effects in a misleadingly described skill materially raises the risk of unauthorized configuration changes or credential leakage.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The documented behavior includes AK/API-key validation, local gateway writes, direct config-file reads/writes, and credential-state inspection, none of which are disclosed by the stated assessment purpose. Combining secret handling with file/network side effects in a misleadingly described skill materially raises the risk of unauthorized configuration changes or credential leakage.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The documented behavior includes AK/API-key validation, local gateway writes, direct config-file reads/writes, and credential-state inspection, none of which are disclosed by the stated assessment purpose. Combining secret handling with file/network side effects in a misleadingly described skill materially raises the risk of unauthorized configuration changes or credential leakage.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The documented behavior includes AK/API-key validation, local gateway writes, direct config-file reads/writes, and credential-state inspection, none of which are disclosed by the stated assessment purpose. Combining secret handling with file/network side effects in a misleadingly described skill materially raises the risk of unauthorized configuration changes or credential leakage.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The documented behavior includes AK/API-key validation, local gateway writes, direct config-file reads/writes, and credential-state inspection, none of which are disclosed by the stated assessment purpose. Combining secret handling with file/network side effects in a misleadingly described skill materially raises the risk of unauthorized configuration changes or credential leakage.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The configuration guide introduces DingTalk message-sending authentication in a skill whose declared purpose is only 1688 inquiry quality evaluation. This capability mismatch is dangerous because it expands the agent's effective privileges into an unrelated external messaging domain, creating a path for unauthorized credential collection or misuse under the guise of a benign evaluation workflow.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
The documented ability to configure credentials for DingTalk sending is unjustified by the skill's stated evaluation-only scope. Unnecessary credentialed functionality increases attack surface and can be abused to exfiltrate secrets, send unauthorized messages, or trick users into provisioning access that the skill does not need.

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
Confidence
88% confidence
Finding
This function explicitly reads the project .env file and imports arbitrary key/value pairs into the process environment. Although the code appears intended for telemetry configuration rather than secret theft, it unnecessarily accesses local configuration material that may include credentials, increasing the chance of accidental misuse, leakage, or propagation to other components.

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
88% confidence
Finding
Opening the root .env file as part of a telemetry helper grants this module access to local configuration data beyond its stated need. In the context of an evaluation skill, that capability is disproportionate and could expose secrets indirectly if later logged, reused, or transmitted by dependent code.

Credential Access

High
Category
Privilege Escalation
Content
os.environ[key] = value


# 模块加载时解析一次 .env
_load_env_file()
Confidence
90% confidence
Finding
Calling _load_env_file() at module import time causes automatic environment ingestion before the user invokes any explicit telemetry action. Import-time secret/config loading is risky because it is implicit, difficult to audit, and may affect unrelated code paths or later network operations without clear user awareness.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The implemented file is a credential-configuration CLI that validates and persists an AK, while the declared skill is for inquiry/customer-service quality evaluation. This mismatch is dangerous because it expands the skill's effective privileges and behavior beyond user expectations, creating a hidden credential-handling surface that could be abused for unauthorized secret collection or persistence.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
This file introduces credential management via validate_ak, configure_via_gateway, configure_via_file, and existing-config checks, which is not justified by a skill meant to assess inquiry handling quality. In this context, hidden secret-handling is especially risky because users invoking an evaluation/reporting skill would not reasonably expect it to read or write access credentials.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
The presence of AK validation, gateway submission, config-file modification, and retrieval logic is not justified by the stated evaluation-only business function. In a mismatched skill, credential-handling capability is especially risky because it can be abused to collect, persist, or reroute sensitive secrets under the cover of an unrelated feature.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
This skill is presented as an inquiry-evaluation/reporting capability, but the file implements configuration management that writes AK credentials into global skill config. That mismatch expands the skill's authority beyond its declared purpose and can enable unauthorized credential persistence or cross-skill configuration changes that a user would not reasonably expect.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill declares no explicit tool scope even though the documented behavior requires access to environment variables, local files, write operations, and network calls. Missing scope boundaries increases the chance that a runtime grants broader capabilities than users or reviewers expect, which is risky here because the skill also handles credentials and external reporting.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The listed trigger words include broad phrases such as "能力提升", "客服怎么样", "团队怎么样", and "询盘怎么样", which are generic enough to appear in normal conversation outside a clear skill-invocation context. The file does not provide exclusion conditions or negative examples to narrow when these phrases should or should not activate the skill.

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
The activation phrases and all user-facing guidance are written only in Chinese, and the skill defines fixed Chinese follow-up prompts and output behaviors without indicating that users may choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly documented and justified.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
Automatic usage telemetry on every CLI execution is unrelated to the core evaluation purpose and creates an undisclosed outbound data flow. Even if the payload is limited, persistent reporting can leak behavioral metadata about when and how the skill is used, which is especially concerning in enterprise contexts.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill omits a user-facing warning that every CLI execution triggers telemetry reporting. Lack of disclosure undermines informed consent and can result in silent transmission of usage metadata to external services, which is a genuine privacy/security concern.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The CLI reports skill usage after every command via `_tracker.report_skill_usage()` with no visible notice, consent, or configuration control in this file. Even if the payload is limited, automatic telemetry can expose user behavior, command usage, and potentially arguments or environment-derived metadata, which is especially sensitive for business evaluation workflows.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This skill exposes detailed salesperson evaluation data that includes buyer identifiers, conversation excerpts, dates, product links, and performance assessments, but the description and workflow do not warn the user that sensitive business and personal data may be returned. The absence of a clear privacy warning and data-minimization guidance increases the risk of unnecessary disclosure, mishandling, or over-sharing of customer communications and employee performance information.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs the agent to ask the user for an Access Key and pass it to a CLI command, but gives no user-facing warning that the value is sensitive or guidance on secure handling. This increases the risk of exposing credentials in chat logs, agent traces, shell history, or downstream tooling, especially because the secret is taken directly from conversation content.

Ssd 3

Medium
Confidence
95% confidence
Finding
Directing the agent to extract an Access Key from the conversation and immediately use it in a command creates a clear secret-handling flaw. Secrets placed in conversational text are more likely to be retained in transcripts and telemetry, and command-line usage can further expose them to process inspection or logs.

Static analysis

No suspicious patterns detected.