Back to skill

Security audit

1688 Distribution Shop Bind Newton

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended for legitimate 1688 shop binding, but it needs review because it can send signed API requests to an environment-selected gateway and open unvalidated browser URLs during authorization.

Install only if you trust the publisher and runtime configuration. Lock DISTRIBUTE_BASE_URL to the official HTTPS 1688 gateway, verify authorization page hostnames before logging in, and avoid exposing this skill to untrusted command arguments or environment variables. Expect Chinese UI text and possible platform collection of stderr tracking logs.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_const.py:14
Finding

Authenticated Requests Can Be Redirected to an Arbitrary Destination

Content
View full analysis

Vulnerability Details

File Location: scripts/_const.py:14-17; request use occurs at scripts/_http.py:89-107 and scripts/_http.py:148-164
Vulnerability Type: Unrestricted authenticated API destination
Risk Level: Medium

Vulnerable Code:

python
# scripts/_const.py:14-17
BASE_URL = os.environ.get(
    "DISTRIBUTE_BASE_URL",
    "https://skills-gateway.1688.com",
)
python
# scripts/_http.py:89-107
url = f"{BASE_URL}{path}"
body_str = json.dumps(body or {}, ensure_ascii=False)

headers = get_auth_headers("POST", path, body_str)
if not headers:
    raise AuthError("AK 未配置")
headers["Content-Type"] = "application/json; charset=utf-8"

try:
    resp = requests.post(
        url,
        headers=headers,
        data=body_str.encode("utf-8"),
        timeout=timeout
    )
    resp.raise_for_status()
except requests.exceptions.HTTPError as e:
    _handle_http_error(e)
python
# scripts/_http.py:148-164
url = f"{BASE_URL}{path}"
body_str = json.dumps(body or {}, ensure_ascii=False)

headers = get_auth_headers("POST", path, body_str)
if not headers:
    raise AuthError("AK 未配置")
headers["Content-Type"] = "application/json; charset=utf-8"

try:
    resp = requests.post(
        url,
        headers=headers,
        data=body_str.encode("utf-8"),
        timeout=timeout
    )
    resp.raise_for_status()
except requests.exceptions.HTTPError as e:
    _handle_http_error(e)

Technical Analysis

The complete API origin is controlled by the DISTRIBUTE_BASE_URL environment variable. The value is used without validating its scheme, hostname, port, or trust relationship with the expected 1688 gateway.

Before each request, the Skill generates authentication headers containing the access-key identifier, timestamp, nonce, request-body digest, and HMAC signature. These headers are then sent to the configured destination. The acces ...[truncated 2175 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require the production API origin to match an explicit allowlist, such as https://skills-gateway.1688.com.
  2. Reject all non-HTTPS schemes, embedded credentials, fragments, unexpected ports, and malformed URLs.
  3. Permit alternate destinations only through an explicit development or test mode that is disabled by default.
  4. Construct endpoints with validated URL parsing and joining rather than direct string concatenation.
  5. Disable redirects for authenticated requests with allow_redirects=False, or manually follow redirects only after validating every destination against the same allowlist.
  6. Ensure deployment tooling prevents untrusted users or child processes from modifying DISTRIBUTE_BASE_URL.
  7. Enforce strict server-side timestamp expiration, nonce uniqueness, and replay prevention for all signed operations.
  8. Avoid including sensitive business data in requests to any development endpoint unless the operator explicitly confirms the destination.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/shop_bind_process/cmd.py:233
Finding

Unvalidated URLs Are Forwarded to the Privileged Electron Browser

Content
View full analysis

Vulnerability Details

File Location: scripts/capabilities/shop_bind_process/cmd.py:233-242; an additional arbitrary-URL interface exists at scripts/capabilities/browser/cmd.py:44-61
Vulnerability Type: Unrestricted browser navigation
Risk Level: Medium

Vulnerable Code:

python
# scripts/capabilities/shop_bind_process/cmd.py:233-242
# If browser interaction is required, return a browser_action
if action_type == "browser" and action_data:
    result["browser_action"] = "open_url"
    result["browser_params"] = {
        "url": action_data.get("url"),
        "wait_for_login": True,
        "timeout": 120,
        "action_name": action_data.get("name", ""),
    }
python
# scripts/capabilities/browser/cmd.py:44-61
if args.action == "open":
    if not args.url:
        _output(False, "请提供 --url 参数。")
        return

    # Return a browser action to the Newton client
    _output(
        success=True,
        markdown=f"正在打开授权页面:{args.url}",
        data={"url": args.url},
        browser_action="open_url",
        browser_params={
            "url": args.url,
            "wait_for_login": args.wait_login,
            "timeout": args.timeout,
        },
    )

Technical Analysis

Shop-binding action URLs originate in gateway response data and are copied directly into an open_url browser action. No validation restricts the URL to HTTPS or to documented authorization domains. The code does not reject local addresses, private or link-local IP ranges, embedded credentials, dangerous schemes, or deceptive domains.

The separate browser command exposes the same behavior for any CLI-supplied URL. Although documented as a debugging feature, it is automatically registered as a normal production command by cli.py.

Because the Newton client interprets browser_action and opens the URL in an Electron browser, the Skill delegates a privileged browser act ...[truncated 1969 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse every URL before creating a browser action and allow only https.
  2. Maintain a narrowly scoped allowlist of documented authorization domains for each supported commerce platform.
  3. Match normalized hostnames exactly or against carefully defined subdomain boundaries; do not use substring matching.
  4. Resolve destination hosts and reject loopback, private, link-local, multicast, and otherwise non-public IP ranges where they are not explicitly required.
  5. Reject URLs containing embedded usernames or passwords, unexpected ports, malformed hosts, and schemes such as file:, javascript:, data:, and custom protocols.
  6. Validate redirect destinations at the Electron navigation layer and block transitions to origins outside the approved allowlist.
  7. Display the normalized destination hostname to the user and require confirmation before leaving an approved first-party origin.
  8. Remove the general-purpose browser command from production registration, or gate it behind an explicit developer-only configuration.
  9. Configure Electron with context isolation, sandboxing, disabled Node.js integration for remote content, restrictive permission handlers, and isolated browser storage.
  10. Treat all gateway-provided step names, descriptions, and URLs as untrusted data rather than authoritative instructions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented behavior suggests generic browser control such as opening arbitrary URLs, closing browser windows, or querying state, which goes beyond a tightly scoped store-binding authorization flow. In an Electron-embedded browser context, overly broad browser control raises phishing, session-misuse, and unintended navigation risks if the action payloads are not tightly restricted to trusted domains and expected flow states.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior suggests generic browser control such as opening arbitrary URLs, closing browser windows, or querying state, which goes beyond a tightly scoped store-binding authorization flow. In an Electron-embedded browser context, overly broad browser control raises phishing, session-misuse, and unintended navigation risks if the action payloads are not tightly restricted to trusted domains and expected flow states.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior suggests generic browser control such as opening arbitrary URLs, closing browser windows, or querying state, which goes beyond a tightly scoped store-binding authorization flow. In an Electron-embedded browser context, overly broad browser control raises phishing, session-misuse, and unintended navigation risks if the action payloads are not tightly restricted to trusted domains and expected flow states.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented behavior suggests generic browser control such as opening arbitrary URLs, closing browser windows, or querying state, which goes beyond a tightly scoped store-binding authorization flow. In an Electron-embedded browser context, overly broad browser control raises phishing, session-misuse, and unintended navigation risks if the action payloads are not tightly restricted to trusted domains and expected flow states.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior suggests generic browser control such as opening arbitrary URLs, closing browser windows, or querying state, which goes beyond a tightly scoped store-binding authorization flow. In an Electron-embedded browser context, overly broad browser control raises phishing, session-misuse, and unintended navigation risks if the action payloads are not tightly restricted to trusted domains and expected flow states.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares capabilities that require environment access, file reads, and network access, but it does not explicitly scope or constrain those permissions in the manifest. That makes the trust boundary unclear and can allow broader-than-expected access to secrets such as API keys or config files, especially in an agent ecosystem where users rely on manifest metadata to understand risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include broad everyday expressions like adding, connecting, or associating a store, which can cause accidental invocation in unrelated conversations. Because this skill can access credentials, read config, perform signed network actions, and launch browser authorization flows, over-triggering increases the chance of unintended sensitive operations or user confusion that can be socially exploited.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document title and instructions specify the output schema entirely in Chinese, and L05 states that all commands uniformly output JSON with a user-facing markdown field, implying a fixed-language presentation. Because there is no indication that users can choose another language or opt in to Chinese output, this creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file uses Chinese-only natural-language documentation and operational messages, and there is no indication that the skill offers users a language/locale choice. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module emits structured telemetry for every flow event to stderr, including channel, appKey, step names, tool names, and truncated error strings, but this file provides no notice, consent, minimization, or filtering of potentially sensitive values. In this skill context, the tracking covers a shop-binding and authorization flow inside an embedded browser, so execution metadata and error content could expose business identifiers or operational details to the host platform without the user's clear awareness.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

文件头注释将该模块定位为测试和调试用途,但后续实现支持打开任意 URL、等待登录完成、关闭浏览器和查询浏览器结果,这些都是实际业务流程中的主动控制能力,而非仅限调试。该说明会弱化对其真实执行权限和业务作用的理解,属于文档意图与代码行为不一致。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring, command description, argument help text, and output messages are all written in Chinese, indicating a fixed language/locale experience. Under the policy, forcing a specific language without user opt-in or a documented region-specific justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains natural-language documentation and error/output strings entirely in Chinese, including the module docstring and later user-facing messages. Under the policy, forcing a specific language without user opt-in is a locale-policy violation unless the restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring, command description, and all user-facing markdown/messages are written exclusively in Chinese, which effectively fixes the interaction language. The file does not indicate that users may choose another language or opt in to Chinese, matching the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file's natural-language documentation is entirely in Chinese and does not indicate that language selection is optional or that the skill is intentionally restricted to a Chinese-only context. Under the policy, forcing a specific language without user opt-in or clear justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

python
filtered_channels = []
        for channel in tool.get("channelList", []):
            filtered_shops = [
                shop for shop in channel.get("shopList", [])
                if not shop.get("channelAuthExpired", False)
            ]
            if filtered_shops:

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

python
filtered_channels = []
        for channel in tool.get("channelList", []):
            filtered_shops = [
                shop for shop in channel.get("shopList", [])
                if not shop.get("channelAuthExpired", False)
            ]
            if filtered_shops:

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

python
filtered_channels = []
        for channel in tool.get("channelList", []):
            filtered_shops = [
                shop for shop in channel.get("shopList", [])
                if not shop.get("channelAuthExpired", False)
            ]
            if filtered_shops:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code's user-facing natural-language content, including the module docstring and usage/help output, is presented only in Chinese. The policy requires avoiding forced language or locale constraints unless the user is given a choice or the limitation is clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The module docstring and comments are written entirely in Chinese, which constitutes a language choice embedded in the skill file. Under the policy, locale or language constraints should either be user-selectable or clearly justified as region-specific; this file provides no such opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language documentation in this file is entirely in Chinese and does not indicate that language selection is optional or constrained by a justified region-specific requirement. Under the policy, forcing a specific language without user opt-in can be a locale/language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The natural-language descriptions and user-facing success/error messages are all hardcoded in Chinese, indicating the skill is designed to operate in a specific language without offering a language choice. This can violate language/locale policy when users have not explicitly opted into Chinese output.

Content

No source excerpt is available for this finding.