Back to skill

Security audit

1688 Multi Shop Compare

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to support the advertised 1688 multi-shop analysis, but it needs review because it handles raw shop credentials and can collect broader shop/customer data than some focused workflows require.

Install only if you are comfortable giving this skill a 1688 AK that can access bound-shop operating and customer-related data. Use a trusted machine, prefer a least-privilege or short-lived AK if available, avoid exposing keys in shared terminals or transcripts, and review whether the automatic telemetry and full-data collection behavior fit your privacy expectations.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/configure/cmd.py:37
Finding

Raw AccessKeys Are Exposed Through Process Arguments and Plaintext Configuration Storage

Content
View full analysis

Vulnerability Details

File Location: scripts/capabilities/configure/cmd.py:37-43, scripts/capabilities/get_shop_data/cmd.py:18-27, scripts/capabilities/configure/service.py:68-80, and SKILL.md:930-935
Vulnerability Type: Credential exposure through command-line arguments and plaintext storage
Risk Level: Medium

Vulnerable Code

scripts/capabilities/configure/cmd.py:37-43:

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)

scripts/capabilities/get_shop_data/cmd.py:18-27:

python
parser = argparse.ArgumentParser(description="获取单个店铺的全量经营数据(商家身份由传入的 AK 自动识别,无需提供 user_id)")
parser.add_argument("--ak", "-a", required=True,
                    help="目标店铺的原始 AK(从 get_bindlist 获取)")
parser.add_argument("--date_type", "-d", default="RECENT_7",
                    choices=["RECENT_7", "RECENT_30"],
                    help="日期类型: RECENT_7(近7天,默认) / RECENT_30(近30天)")
args = parser.parse_args()

try:
    result = get_shop_data(args.ak, args.date_type)

scripts/capabilities/configure/service.py:68-80:

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

The configuration command reads the raw AccessKey directly from sys.argv, while the sho ...[truncated 2231 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove raw AccessKeys from command-line arguments.

    • Read secrets from protected standard input with terminal echo disabled.
    • Prefer an OpenClaw secret-provider API, operating-system keychain, or inherited protected file descriptor.
    • Replace cross-shop raw keys with short-lived, opaque server-side shop identifiers where the gateway supports them.
  2. Remove plaintext fallback storage where possible.

    • Store credentials in a dedicated secret manager rather than the general OpenClaw JSON configuration.
    • If file storage is unavoidable, create the file atomically with mode 0600, verify that it is owned by the current user, and reject symbolic links and unexpected file types.
    • Correct overly broad permissions on existing files before writing.
  3. Prevent secondary disclosure.

    • Never include raw AccessKeys in logs, exceptions, command usage examples, telemetry, or Agent-visible output.
    • Redact process invocation details in execution telemetry.
    • Document credential rotation procedures and advise rotation after suspected transcript or host exposure.
  4. Use scoped and short-lived credentials where supported.

    • Limit each credential to the minimum read-only endpoints needed.
    • Avoid distributing complete shop signing secrets to the Agent execution layer.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/capabilities/get_shop_data/service.py:114
Finding

Focused Analysis Modes Unconditionally Retrieve Unnecessary Customer and Business Data

Content
View full analysis

Vulnerability Details

File Location: scripts/capabilities/get_shop_data/service.py:114-197, scripts/capabilities/get_shop_data/cmd.py:18-27, and SKILL.md:226-233
Vulnerability Type: Excessive data access and failure to enforce least-privilege collection
Risk Level: Medium

Vulnerable Code

scripts/capabilities/get_shop_data/cmd.py:18-27 exposes only an AccessKey and date selector, with no dimension or focus selector:

python
parser = argparse.ArgumentParser(description="获取单个店铺的全量经营数据(商家身份由传入的 AK 自动识别,无需提供 user_id)")
parser.add_argument("--ak", "-a", required=True,
                    help="目标店铺的原始 AK(从 get_bindlist 获取)")
parser.add_argument("--date_type", "-d", default="RECENT_7",
                    choices=["RECENT_7", "RECENT_30"],
                    help="日期类型: RECENT_7(近7天,默认) / RECENT_30(近30天)")
args = parser.parse_args()

try:
    result = get_shop_data(args.ak, args.date_type)

scripts/capabilities/get_shop_data/service.py:127-195 unconditionally invokes all data dimensions:

python
result = {}

result["trade_index"] = _safe_call(
    lambda: _fetch_trade_index(raw_ak, date_type),
    "trade_index"
)

result["core_metrics"] = _safe_call(
    lambda: _fetch_core_metrics(raw_ak, date_type),
    "core_metrics"
)

result["traffic_trend"] = _safe_call(
    lambda: _fetch_traffic_trend(raw_ak, days=7 if date_type == "RECENT_7" else 30),
    "traffic_trend"
)

result["abnormal_offer"] = _safe_call(
    lambda: _fetch_abnormal_offer(raw_ak, date_type),
    "abnormal_offer"
)

result["top_offer_by_pay_amt"] = _safe_call(
    lambda: _fetch_top_offer(raw_ak, order_by="payAmt", range_type=date_type),
    "top_offer_by_pay_amt"
)

result["top_offer_by_uv"] = _safe_call(
    lambda: _fetch_top_offer(raw_ak, order_by="uv", range_type=date_type),
    "top_offer_by_uv"
)

result["top_offer_by_new_buyer"] = _safe_call(
    lambda: _fetch_top_o
...[truncated 3303 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add an allow-listed focus or dimension parameter.

    • Support values such as business_overview, product_diagnosis, customer_geography, and full.
    • Map each value to a fixed set of permitted endpoint calls.
    • Reject unknown dimensions rather than falling back to full collection.
  2. Default to the smallest data set.

    • Retrieve only transaction metrics, core metrics, and traffic trends unless the user explicitly selects another scope.
    • Require explicit confirmation before collecting customer-level records.
  3. Separate sensitive customer access.

    • Place customer-detail retrieval behind a distinct command or capability.
    • Return pseudonymized or hashed buyer identifiers when exact identifiers are not required.
    • Avoid returning unused response fields to the Agent.
  4. Enforce minimization in the service layer.

    • Do not rely only on Agent instructions to omit endpoints.
    • Build the endpoint execution plan from a validated server-side allow list.
    • Add tests proving that each focused mode calls only its documented endpoints.
  5. Limit retention and propagation.

    • Prevent customer records from being written to logs or long-lived transcripts.
    • Define retention limits for analysis responses.
    • Pass only derived aggregates to visualization and downstream optimization components where raw records are unnecessary.
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (44)

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

Critical
Category
Data Flow
Confidence
91% confidence
Finding

The service constructs the PATCH target from the OPENCLAW_GATEWAY_URL environment variable and sends the provided API key plus optional bearer token to that destination without validating the scheme, host, or trust boundary. If an attacker can influence the environment or runtime configuration, they can redirect credential-bearing requests to an attacker-controlled endpoint, causing secret exfiltration or SSRF-like behavior against internal services.

Content

Scanner excerpt · scripts/capabilities/configure/service.py (reported line 49)May include surrounding context.

python
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:

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Reading environment variables and local configuration files and writing API credentials to local or gateway-backed storage are privileged behaviors that are not clearly surfaced in the declared purpose. In this context, the mismatch is especially risky because the skill processes shop bindings and AKs, so hidden configuration management can expose or misuse sensitive account access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file metadata declares a generic 'report-to-visualization' skill that does not match the manifested 1688 multi-shop comparison purpose. This capability mismatch can cause the agent to activate unrelated behavior, expanding scope beyond the advertised skill and enabling prompt-surface confusion or unauthorized task routing.

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 · scripts/_tracker.py (reported line 13)May include surrounding context.

python
_ROOT_DIR = Path(__file__).parent.parent

def _load_env_file() -> None:
    env_path = _ROOT_DIR / ".env"
    if not env_path.exists():
        return
    with open(env_path, encoding="utf-8") as f:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares executable capabilities including environment access, file reads/writes, and network use, but does not declare any tool scope or permission boundaries. In a skill that handles access keys and local configuration, this increases the risk of overbroad execution, unintended data access, and silent exfiltration paths if the implementation or dependencies are compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill states that every CLI command automatically reports usage to an external API and silently ignores failures, but there is no user-facing warning or consent mechanism for this network transmission. In a commercial analytics skill handling shop relationships and potentially sensitive operational context, silent telemetry weakens user privacy expectations and can leak metadata about usage patterns.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI invokes a telemetry function after every command execution even though the stated purpose of the skill is multi-shop analysis, not usage reporting. Because this happens automatically and exceptions are suppressed, users have no clear visibility into what data is sent, making this an undisclosed data-flow risk that could expose shop identifiers, usage metadata, or operational context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Telemetry is triggered on every command with no visible warning, prompt, or disclosure in this file, which creates a transparency and privacy problem. In a skill that processes potentially sensitive multi-shop business data and account bindings, silent reporting increases the risk that operational or commercial metadata is exported without user awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire document is written in Chinese and presents mandatory instructions such as “必须” and “严格参照” without offering any language choice or explaining a locale-specific requirement. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

该规范从标题到核心约束均以中文固定描述交互输出要求,体现出技能交互被默认限定为单一语言。根据规则,若未提供用户语言/locale 选择或未说明这是特定区域场景所必需,则属于自然语言层面的语言策略违规。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger phrases include broad terms such as requests for visualization or chart-based presentation, which can overlap with many normal user requests outside this skill's domain. Overbroad activation criteria can cause incorrect skill invocation and privilege or instruction boundary bleed between unrelated tasks.

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 user-facing description and all operating instructions are written entirely in Chinese, and the skill name/behavior imply Chinese-language output conventions without offering a language choice. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless clearly documented as region-specific and justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This section defines a broad, reusable transformation workflow for arbitrary report-to-visualization conversion, which exceeds the stated shop-comparison scope. Such unjustified generic capability increases the attack surface by making the skill eligible for wider classes of prompts and may let users bypass intended business-domain restrictions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code performs outbound network requests via requests.post and includes both the request body and auth headers, which may contain user or system data. While there is internal logging for retry failures, there is no confirmation prompt, user-facing notice, or explanatory warning in comments/docstrings about data transmission risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The functions obtain auth headers from local credential material and also accept a raw AK for signing requests, which is a sensitive credential-handling operation. The docstrings describe functionality but do not warn that credentials are being used to authenticate remote requests.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file performs outbound telemetry by calling api_post with skill name, version, and channel, but this behavior is not evident from the stated business-analysis purpose. Undisclosed network reporting is a supply-chain and privacy concern because it creates an unexpected data flow from the user's environment to a remote endpoint, even if the payload is limited to metadata.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The telemetry path sends metadata to a remote API without any visible disclosure, prompt, or consent mechanism in this file. Hidden reporting is risky because users may not expect network communication from a comparison-analysis skill, and the remote dependency could later be changed to collect more information.

Content

No source excerpt is available for this finding.