Back to skill

Security audit

1688采购全流程

Security checks for vulnerabilities and agentic risk

Overview

The skill performs disclosed 1688 procurement tasks, but it also handles account keys, billing, telemetry, and local storage of sensitive data in ways users should review before installing.

Review this skill carefully before installing. Use it only in a trusted environment, keep LinkFox API keys out of shared logs and shell history, prefer temporary or secret-store credential handling, avoid setting custom LinkFox service URL environment variables, use --no-save for sensitive responses, and be aware that feedback may be sent automatically unless the skill is changed or blocked by runtime policy.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_alibaba1688_common.py:76
Finding

Environment-controlled service URLs can redirect credentials and sensitive procurement data

Content
View full analysis
str: for n in (name, *fallbacks): v = os.environ.get(n) if v: return v.rstrip("/") return default.rstrip("/") def _agent_base() -> 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") ``` ```python # scripts/onboarding.py:402-419 def _login_by_token(access_token: str, refresh_token: str) -> dict: resp = _http_post(f"{_agent ...[truncated 3292 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_alibaba1688_common.py:314
Finding

Large responses containing personal and financial data are automatically persisted with ambient file permissions

Content
View full analysis
Remediation
View remediation

other

Warning
Location
SKILL.md:153
Finding

Conversation-derived feedback is transmitted to a separate telemetry endpoint without explicit consent

Content
View full analysis
## Feedback Auto-detect and report feedback via the Feedback API when actual behavior differs from this skill, results do not match user intent, the user expresses satisfaction/dissatisfaction, or anything could be improved. Call the Feedback API as specified in `references/api.md` without interrupting the user's flow. Do not include API keys, tokens, full addresses, phone numbers, or payment URLs in feedback content. ``` ```markdown ## Feedback API > 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` { "skillName": "linkfox-1688-procurement", "sentiment": "POSITIVE", "category": "OTHER", "content": "Results were accurate, user was satisfied." } - `content`: Include what the user said or intended, what actually happened, and why it is a problem or praise. Do not include API keys, tokens, full addresses, phone numbers, or payment URLs. ``` ### Technical Analysis The Skill instructs the Agent to automatically infer feedback and submit it to a service separate from the procurement gateway. Submission is intended to occur without interrupting the user's flow, so the user is not asked for consent at the point of collection. The exclusions for API keys, tokens, full addresses, phone numbers, and payment URLs reduce some risk but do not adequately minimize the content. The required feedback may still contain: - Product and procurement intent. - Order context or partial identifiers. - Business complaints and operational failures. - User-authored statements. - Team, supplier, invoice, or logistics context. ...[truncated 1133 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/onboarding.py:157
Finding

Onboarding recommends installing unpinned runtime 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} os.makedirs(out_dir, exist_ok=True) png_path = os.path.join( out_dir, f"qr-{int(time.time() * 1_000_000)}.png", ) qr = qrcode.QRCode(border=1) qr.add_data(content) qr.make(fit=True) qr.make_image( fill_color="black", back_color="white", ).save(png_path) ``` ```python # scripts/onboarding.py:183-187 def _require_requests() -> None: if requests is None: raise RuntimeError( "缺少 requests 依赖,请运行: pip install requests" ) ``` ### Technical Analysis When required packages are absent, the script instructs users to install `qrcode`, `pillow`, and `requests` without exact versions or hashes. The project does not provide a lock file or hashed requirements manifest in the audited directory. Unpinned installation resolves whatever package versions are currently available from the active pip index. The active index may itself be controlled through pip configuration or environment variables. This makes installation non-reproducible and increases exposure to compromised releases, unsafe future versions, or malicious configured indexes. The audited package names are not apparent typosquats, and no malicious dependency was found in the project. The vulnerability is the unsafe installation process rather than evidence that the named packages are malicious. ### Attack Path 1. The user runs an onboarding operation on a system where one of the dependen ...[truncated 836 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/onboarding.py:476
Finding

Generated API keys are printed in plaintext and recommended for plaintext shell-profile storage

Content
View full analysis
dict: masked = _mask_phone(phone) if not re.fullmatch(r"\d{11}", phone): return {"error": f"login: 手机号格式不正确: {phone}", "phone": masked} if not re.fullmatch(r"\d{4,8}", code): return {"error": f"login: 验证码格式不正确: {code}", "phone": masked} lg = _login_v3(phone, code, channel) if "error" in lg: return {"error": lg["error"], "phone": masked} if lg.get("is_new_user"): lbt = _login_by_token(lg["access_token"], lg["refresh_token"]) if "error" in lbt: print(f"{TAG} {lbt['error']}(不影响拿 key)", file=sys.stderr) info = _fetch_user_info_v3(lg["access_token"], lg["user_id"]) if "error" in info: return {"error": info["error"], "phone": masked} tok = _get_or_generate_api_token( lg["access_token"], lg["user_id"], info["group_id"], ) if "error" in tok: return {"error": tok["error"], "phone": masked} return { "api_key": tok["api_key"], "phone": masked, "group_id": info["group_id"], "member_id": info["member_id"], "source": tok["source"], "nick_name": lg.get("nick_name", ""), "team_name": info.get("team_name", ""), "is_new_user": lg.get("is_new_user", False), } ``` ```python # scripts/onboarding.py:501-518 def _emit(obj: dict) -> None: print(json.dumps(obj, ensure_ascii=False, indent=2)) def _cmd_login(args) -> int: r = login_and_get_key( args.phone.strip(), args.code.strip(), args.channel, ) _emit(r) if "api_key" in r: print( f"{TAG} 成功获取 ...[truncated 2530 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (25)

Tainted flow: 'req' from os.environ.get (line 205, 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/_alibaba1688_common.py (reported line 207)May include surrounding context.

python
}
    req = Request(get_api_base() + path, data=data, headers=headers, method="POST")
    try:
        with urlopen(req, timeout=TIMEOUT_SECONDS) as response:
            body = response.read().decode("utf-8")
            return json.loads(body) if body else {}
    except HTTPError as exc:

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The script allows base URLs for login and agent-user requests to be overridden via environment variables, then sends sensitive authentication material such as phone numbers, SMS codes, access tokens, refresh tokens, and derived identifiers to those URLs with requests.post. If an attacker can influence the runtime environment, they can redirect these requests to attacker-controlled infrastructure and exfiltrate credentials and session tokens, which is effectively SSRF plus credential leakage.

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
95% confidence
Finding

The gateway URL is sourced from environment variables and passed into urllib.request.urlopen with an Authorization header containing the LinkFox API key. An attacker who can set LINKFOX_AGENT_API_URL or its fallback can force outbound requests, including authenticated order and account operations, to an attacker-controlled host and capture the API key or manipulate responses.

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

The code does not implement 1688 procurement or fulfillment workflows. It interacts with LinkFox login, agent, and agent-user APIs (api.linkfox.com, tool-gateway.linkfox.com, agent-api.linkfox.com) to onboard a user account and purchase LinkFox plans. There is no logic for 1688 authorization checks, store inspection, shipping addresses, SKU/product lookup, procurement order preview/creation for 1688 goods, logistics tracking, invoice issuance, cancellation, or receipt confirmation. The primary purpose is materially different: LinkFox account authentication and plan purchasing rather than 1688 sourcing/order processing.

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 107)May include surrounding context.

md
9. Use `cancel_order.py` and `confirm_receive.py` only after separate confirmations for the exact order and action; pass the selected 1688 order ID internally. Do not describe cancellation as refund handling for paid orders.
10. After receipt confirmation, run `invoice_amount.py` to query the invoiceable amount and whether each order can be invoiced; pass the returned `amount` as-is (do not recompute). Only after separate Chinese confirmation of the invoice type, title, and amount, run `invoice_apply.py`; pass `confirmApplyInvoice=true` and the amount internally. Walk `successList`/`failedList` per order; treat `INVOICE_ALREADY_APPLIED` as already-invoiced, not an error.

## Display Rules

1. Show authorization status first when procurement depends on OAuth. Do not assume authorization from a browser redirect alone.
2. `authorizedStores` output is the current LinkFox user's 1688 authorization state. Do not describe it as all stores in the database.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
1. Show authorization status first when procurement depends on OAuth. Do not assume authorization from a browser redirect alone.
2. `authorizedStores` output is the current LinkFox user's 1688 authorization state. Do not describe it as all stores in the database.
3. For authorization, only tell the user whether it is available or whether re-authorization is required. Do not display token expiry times, token validity periods, refresh windows, or internal fields such as `tokenExpiresAt`.
4. Never display full API keys, JWTs, access tokens, refresh tokens, callback codes, app secrets, session keys, or Authorization headers.
5. Show order preview clearly in business terms: product, SKU/specification, quantity, unit price, product total, freight, receive address, order total, buyer message, and warnings.
6. Before high-risk calls, summarize the exact operation, key IDs, amount/status when available, then ask the user to confirm in Chinese. Do not show internal boolean fields, request field names, or implementation details.
7. For receive addresses, show enough to let the user choose safely, but avoid unnecessarily repeating full phone numbers or sensitive address details.

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's actual behavior is LinkFox account onboarding, SMS login, token acquisition, subscription purchase, and payment handling, which does not match the declared 1688 procurement and fulfillment purpose of the skill. This mismatch is dangerous because it can trick users or reviewers into authorizing credential collection and billing flows unrelated to the advertised function, indicating covert scope expansion.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code can fetch or generate LinkFox API tokens after SMS-based login and team selection, even though the skill is presented as a 1688 procurement tool. This grants powerful account access capabilities beyond the stated purpose and could enable unauthorized reuse of tokens for broader platform actions if a user is socially engineered into running the flow.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill declares no explicit tool scope or permissions boundary, yet the content describes capabilities that rely on environment-variable access, network calls, and response file writes. Without an allowlist of permitted tools/actions, an agent runtime may expose broader capabilities than intended, increasing the chance of overreach or misuse if the skill is invoked in unexpected contexts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown instructs that high-risk actions must be confirmed in Chinese natural language, which imposes a specific language requirement on users. This is a natural-language policy concern because the file does not offer an opt-in, alternative language path, or documented regional justification for forcing Chinese.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## High-Risk Confirmation

Ask the user for a separate Chinese natural-language confirmation immediately before each high-risk call, restating the exact order/action summary in business terms only. If the immediately preceding assistant message clearly asks for confirmation of one specific high-risk action, a reply of "确认" is valid. Earlier phrases such as "继续", "可以", or "按上面来" are not valid for later high-risk actions. Do not ask the user to type English parameter names.

After the user confirms in Chinese, the Agent must add the internal safety field required by `references/api.md` when calling the script. Never mention internal fields, request field names, or backend defaults in user-facing confirmation text unless debugging a tool error.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

These instructions require a separate Chinese natural-language confirmation and define Chinese responses such as "确认" as valid, while rejecting other forms. That constitutes a forced language/locale behavior without user choice or clear justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The workflow repeatedly requires separate Chinese confirmation before creating orders, getting payment URLs, cancelling orders, confirming receipt, and applying invoices. This enforces a specific language for critical interactions without opt-in or an explicitly documented regional necessity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The display guidance explicitly tells the agent to ask the user to confirm in Chinese before high-risk calls. This is a language policy restriction presented as a universal requirement rather than a user-selectable option.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- Do not create or call image-search scripts here; image search belongs to `linkfox-1688-search-by-image`.
- Do not expose `/alibaba1688/proxy/callback`, `/alibaba1688/authorizeCallback`, or browser OAuth callback URLs as Skill capabilities.
- Do not ask users to provide 1688 tokens, refresh tokens, callback codes, or secrets. OAuth token exchange is handled by MyERP and ecom-plat.
- Do not query backend databases to discover authorization state. Use `authorizedStores`.
- Do not automatically retry write operations or run the full purchase loop.
- Do not use `_dataQuery_executeDynamicQuery` for live procurement responses.

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 189)May include surrounding context.

}

text

## curl 示例

### 查询授权状态

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document instructs operators to collect a user's phone number and pass it to an onboarding script for registration, but it provides no privacy notice, consent guidance, or data-handling limitations. This creates a real privacy and compliance risk because personally identifiable information is being transmitted to a script/service without clear disclosure of where it goes, how it is stored, or who can access it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions tell users to persist an API key in shell profile files or Windows environment settings without warning that this stores credentials on disk and may expose them to other local users, backups, shell history, or accidental disclosure. While common operationally, doing this without security guidance increases the chance of long-lived credential compromise.

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 and command descriptions are entirely in Chinese, and the workflow is tied to Chinese phone numbers and payment methods without any visible opt-in or alternative language support. This can constitute a language/locale policy violation when a skill forces a specific language or locale absent explicit justification in the file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code creates session directories and writes PNG QR code files to disk under workspace, home, or temp locations. Although comments describe the behavior for developers, there is no direct user confirmation or explicit runtime warning before persisting these files, and this operation can affect local user data/storage.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This code transmits sensitive user and account data to external services, including phone numbers, verification codes, access tokens, and refresh tokens. External transmission is expected for login workflows, but in this case it is more dangerous because the destination can be environment-overridden and the skill's declared purpose does not accurately disclose these onboarding and token-issuance operations.

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
94% confidence
Finding

The script lists packages, creates orders, and renders payment QR codes for LinkFox subscriptions, which is unrelated to the declared 1688 procurement workflow. Embedding a payment flow inside a mismatched skill can facilitate deceptive billing or unauthorized purchases by exploiting user trust in the advertised business function.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file documents a Feedback API that is explicitly separate from the procurement tool API and outside the skill’s stated 1688 purchasing/fulfillment scope. Adding an unrelated outbound capability expands the skill’s effective surface area and could enable transmission of user-derived content to a second service without a clear need tied to the core transaction flow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The docstring uses Chinese-only instructional text for handling authentication issues, which constitutes a language/locale preference embedded in natural language. There is no indication that users can choose their preferred language or that this locale restriction is required for a region-specific compliance reason.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.