Back to skill

Security audit

Temu类目搜索

Security checks for vulnerabilities and agentic risk

Overview

This skill is presented as Temu category lookup, but it also performs remote authenticated calls, account onboarding, API-key generation, and payment-order workflows that users should review carefully before installing.

Install only if you expect LinkFox-hosted network calls, account onboarding, API-key handling, and billing/payment support inside this Temu category-search skill. Avoid entering phone numbers, SMS codes, or payment choices through this skill unless you trust the publisher and runtime environment, and ensure LINKFOX endpoint environment variables cannot be overridden by untrusted workspace or shell settings.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onboarding.py:513
Finding

Sensitive credentials are exposed through process arguments and standard output

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 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} 成功获取 API key(来源: {r['source']})", file=sys.stderr) return 0 return 1 ``` ```python p = sub.add_parser("login", help="验证码登录并获取 API key") p.add_argument("phone") p.add_argument("code", help="短信验证码") p.add_argument("--channel", default="skill", help="渠道,默认 skill;workbuddy 宿 ...[truncated 2132 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/temu_category_search.py:36
Finding

Environment-controlled endpoints can receive authentication credentials

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", ""), "MODE_ID": os.environ.get("MODE_ID", ""), "APP_NAME": os.environ.get("APP_NAME", ""), } req = Request( api_url, data=data, headers=headers, method="POST", ) try: with urlopen(req, timeout=150) as response: return json.loads(response.read().decode("utf-8")) ``` The onboarding workflow similarly permits environment replacement of sensitive destinations: ```python 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 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)) ...[truncated 2467 chars]
Remediation
View remediation

other

Note
Location
scripts/temu_category_search.py:60
Finding

Category searches transmit execution metadata beyond the documented API requirements

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/onboarding.py:162
Finding

Onboarding recommends unpinned third-party package installation

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) buf = io.StringIO() qr.print_ascii(out=buf, invert=True) return {"png_path": png_path, "ascii_qr": buf.getvalue()} def _require_requests() -> None: if requests is None: raise RuntimeError("缺少 requests 依赖,请运行: pip install requests") ``` ### Technical Analysis When optional dependencies are unavailable, the script instructs users to install `qrcode`, `pillow`, and `requests` without version constraints, hashes, a lockfile, or a trusted package-index requirement. The script does not automatically execute these installation commands, and no typosquatted package name was identified. Nevertheless, following the guidance causes package versions to be resolved dynamically from the user's configured Python index. Installation and subsequent import of third-party packages can execute package-controlled code. The absence of pinned, reviewed versions also creates reproducibility and compatibility risks even when the package source is legitimate. ### Attack Path 1. A user invokes onboarding in an environment where one of the dependencies is absent. 2. The script displays an instruction such as `pip install requests`. 3. The user runs the command against the environment's configured ...[truncated 695 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (24)

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

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The code sends authentication data and other sensitive request bodies to URLs derived from environment-controlled base URLs. If an attacker can influence environment variables, they can redirect SMS login, token, or account traffic to an attacker-controlled endpoint and capture credentials or API keys. The danger is amplified because this skill is supposed to search a local Temu category dataset, so these outbound auth flows are unnecessary and suspicious in context.

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 request uses a URL built from environment-controlled API bases and transmits the bearer API key in the Authorization header via urlopen. An attacker who can set the environment can exfiltrate the API key or redirect order/account requests to arbitrary infrastructure. In a skill advertised as local Temu category lookup, such network-capable account and billing behavior is especially dangerous and unjustified.

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

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

Critical
Category
Data Flow
Confidence
97% confidence
Finding

The request sent via urlopen includes environment-derived values in headers and can also use an environment-controlled base URL through LINKFOX_TOOL_GATEWAY. This creates a real exfiltration/SSRF-style risk: sensitive values such as the API key and session metadata may be transmitted to an attacker-controlled endpoint if the environment is poisoned or the runtime is untrusted.

Content

Scanner excerpt · scripts/temu_category_search.py (reported line 79)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 ""

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to search a locally synced category database, but the finding indicates remote API access, persistence of full responses to local files/cache, session metadata management, and fallback writing to temporary directories. This materially expands data exposure and persistence risk, especially when users expect an offline/local-only lookup with no outbound calls or retained artifacts.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims to search a locally synced category database, but the finding indicates remote API access, persistence of full responses to local files/cache, session metadata management, and fallback writing to temporary directories. This materially expands data exposure and persistence risk, especially when users expect an offline/local-only lookup with no outbound calls or retained artifacts.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file introduces authentication recovery, SMS-based onboarding, and billing workflows that are unrelated to the stated purpose of a Temu category-search skill. This expands the skill’s effective capability into account provisioning and payment handling, creating unnecessary access to sensitive flows and increasing the risk of social engineering, credential mishandling, or unauthorized monetization.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill instructs the agent to collect a user phone number, send an SMS code, log in, obtain an API key, and guide users through purchasing plans, none of which are justified by the declared category-search function. In this context, these are over-scoped capabilities that expose users to account takeover risk, sensitive data collection, and financial actions through a skill that users would not expect to handle identity or payments.

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
证码后:`python scripts/onboarding.py login <phone> <code>`(workbuddy 宿主加 `--channel workbuddy`)
   - 拿到 `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 implemented behavior materially differs from the declared skill purpose: instead of searching local Temu category data, it performs account onboarding, login, API-key retrieval, package listing, ordering, and payment QR generation. Such capability mismatch is a strong indicator of deceptive packaging and can trick users or orchestrators into running credential and payment workflows under a benign label.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code can create purchase orders and render payment QR codes, capabilities unrelated to local category lookup. In the stated skill context, this introduces unauthorized billing or social-engineering risk by causing users to initiate payments through a tool they would not expect to handle commerce.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This section performs SMS authentication, token-based login, team discovery, and API-token generation, none of which are needed for local Temu category search. It can collect a user's phone number and verification code, then mint reusable API credentials, creating a severe credential theft and account takeover risk under misleading skill branding.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The implementation contradicts the stated behavior by calling a remote gateway API instead of searching a local synced Temu category dataset. This means user queries and associated metadata leave the local environment unexpectedly, which is especially dangerous because users and operators may rely on the skill description to make trust decisions about data locality.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares itself as a local Temu category search, but the content references code paths requiring environment variables, network access, and local file writes without any explicit tool-scope restriction. That creates an unnecessary privilege surface and prevents reviewers or runtime policy from constraining the skill to the minimum capabilities needed.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger text is very broad and says the skill should activate even when the user does not mention the tool name, as long as a category ID lookup is inferred. Overbroad activation can cause the skill to run in unrelated contexts and, given the other findings, may invoke networked/authenticated behavior unexpectedly.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The API reference for a Temu category search skill includes a separate feedback-submission API that is unrelated to the skill’s core purpose. This can prompt an agent to invoke an unnecessary external write-capable endpoint, creating a risk of unintended data exfiltration, spurious network access, or manipulation of user/session-derived content under the guise of normal skill operation.

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 the operator to ask for and use a user’s phone number for scripted registration, but provide no explicit privacy notice, retention limits, consent language, or guidance on safe handling of personal data. This makes accidental overcollection or insecure processing of personally identifiable information more likely, especially because the skill’s advertised purpose does not suggest phone-number collection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The order workflow writes QR code PNGs to disk in a session directory without clear in-file disclosure or access controls. Payment artifacts and related session files may remain on shared systems, be indexed, or be accessed by other users or processes, creating privacy and misuse risks.

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

The file performs broad external network interaction with multiple LinkFox APIs even though the declared skill should operate on already-synced local data. This expands the attack surface, enables credential or metadata exfiltration, and hides remote side effects behind a benign search-oriented interface.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The login command emits the generated API key directly to stdout JSON. In agent, CI, terminal logging, or orchestration contexts, stdout is often captured, persisted, or shown to other components, so this can leak reusable credentials far beyond the intended recipient. Because the skill is mislabeled as a local category search tool, users may not anticipate that a secret will be produced and exposed this way.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring, usage guidance, and operational descriptions are written entirely in Chinese, and user-facing runtime messages later in the file also assume Chinese. For a general-purpose category-search skill, this creates a language/locale constraint without opt-in or justification, matching the policy concern for forced language behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script persists full API responses to disk and catalogs them in session metadata even though the skill is presented as a simple category lookup tool. This expands the data exposure surface by leaving potentially sensitive query contents, identifiers, and response data in project, home, or temp storage where other processes or users may later access them.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation says writing to /tmp is forbidden and that failure to write the current directory should cause an error, but the code silently falls back to home and temp directories. This can place data in less controlled locations than operators expect, undermining security assumptions and potentially exposing stored responses to other users or cleanup processes.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The inline comment at L030 says responses under the threshold are output directly and not written to file. In main, the script serializes the result and writes it to out_path unconditionally before checking SMALL_THRESHOLD, so the comment contradicts actual behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.