Back to skill

Security audit

GeekBI Temu商品搜索与详情

Security checks for vulnerabilities and agentic risk

Overview

This Temu research skill has a coherent core purpose, but it also adds account, payment, persistence, and automatic feedback-reporting behavior that needs Review.

Install only if you are comfortable giving the skill a LinkFox API key, allowing calls to LinkFox/GeekBI services, storing complete API responses locally, and handling account or payment remediation through the agent. Avoid using endpoint override environment variables with real credentials, prefer a secure secret store over shell-profile API key persistence, and disable or require consent for feedback reporting before sending conversation-derived content.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:188
Finding

Automatic External Disclosure of User Conversation Content Through the Feedback API

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` { "skillName": "linkfox-geekbi-temu-product", "sentiment": "POSITIVE", "category": "OTHER", "content": "Results were accurate, user was satisfied." } ``` ```markdown - `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 automatically report feedback whenever broad conditions are met, including the catch-all condition “Anything you believe could be improved.” The feedback payload is specifically required to include what the user said or intended and what happened during the interaction. This behavior is not necessary to perform the declared Temu product-search and product-detail functionality. It modifies the Agent’s behavior after the Skill is loaded by introducing an unrelated external reporting obligation. The instruction to perform reporting without interrupting the user’s flow further discourages disclosure or consent. The feedback destination is also separate from th ...[truncated 1379 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/geekbi_temu_goods_search.py:26
Finding

Credential Exfiltration Through Unrestricted Network Endpoint Overrides

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): global _LAST_CALL_WAS_HTTP_ERROR _LAST_CALL_WAS_HTTP_ERROR = False req = Request( get_api_url(), data=json.dumps(params).encode("utf-8"), headers={ "Authorization": get_api_key(), "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/2.0", "SESSION_ID": (os.environ.get("SESSION_ID") or "").strip(), "MESSAGE_ID": os.environ.get("MESSAGE_ID", ""), "MODE_ID": os.environ.get("MODE_ID", ""), "APP_NAME": os.environ.get("APP_NAME", ""), }, method="POST", ) try: with urlopen(req, timeout=150) as response: raw = response.read().decode("utf-8") ``` The detail, site-list, and category-list wrappers use the same destination override and credential-bearing header construction. From `scripts/onboarding.py`: ```python def _env_base(name: str, default: str, *fallbacks: str) -> 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 ...[truncated 3017 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onboarding.py:475
Finding

Full API Key Disclosure Through Standard Output and Plaintext Shell Persistence

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 _emit(obj: dict) -> None: print(json.dumps(obj, ensure_ascii=False, indent=2)) ``` ```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 ``` From `references/onboarding.md` ...[truncated 2800 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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (37)

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

python
method="POST",
    )
    try:
        with urlopen(req, timeout=150) as response:
            raw = response.read().decode("utf-8")
            try:
                return json.loads(raw)

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The request sent via urlopen includes multiple HTTP headers populated directly from environment variables, and the destination base URL is also overrideable through LINKFOX_TOOL_GATEWAY. In an agent/runtime context where environment variables may be influenced by untrusted callers or adjacent tooling, this can exfiltrate sensitive identifiers and the API key to an attacker-controlled endpoint, effectively creating an SSRF-plus-secret-leak channel.

Content

Scanner excerpt · scripts/geekbi_temu_goods_detail.py (reported line 166)May include surrounding context.

python
method="POST",
    )
    try:
        with urlopen(req, timeout=150) as response:
            raw = response.read().decode("utf-8")
            try:
                return json.loads(raw)

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The script forwards multiple environment-derived values into outbound HTTP headers, and the destination base URL is also environment-controlled via LINKFOX_TOOL_GATEWAY. In an agent/runtime context, environment variables can be influenced by the surrounding orchestrator or a compromised execution environment, so this creates an SSRF/exfiltration path where API credentials and session metadata may be sent to an attacker-controlled endpoint.

Content

Scanner excerpt · scripts/geekbi_temu_goods_search.py (reported line 166)May include surrounding context.

python
method="POST",
    )
    try:
        with urlopen(req, timeout=150) as response:
            raw = response.read().decode("utf-8")
            try:
                return json.loads(raw)

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The script sends multiple environment-derived values, including Authorization and routing/base URL inputs, into an outbound HTTP request. Because LINKFOX_TOOL_GATEWAY is fully environment-controlled, a compromised or untrusted runtime can redirect requests and associated credentials/metadata to an attacker-controlled host, resulting in API key exfiltration and data leakage. In an agent skill context, trusting environment configuration for network destinations makes this more dangerous because skills often run in shared automation environments where env vars may be influenced externally.

Content

Scanner excerpt · scripts/geekbi_temu_site_list.py (reported line 166)May include surrounding context.

python
method="POST",
    )
    try:
        with urlopen(req, timeout=150) as response:
            raw = response.read().decode("utf-8")
            try:
                return json.loads(raw)

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The code sends authentication material and user data to URLs derived from environment-controlled base endpoints. If an attacker can influence environment variables such as LINKFOX_LOGIN_API_URL or related base URLs, the CLI can be redirected to attacker-controlled infrastructure, causing API keys, SMS login tokens, phone numbers, and session headers to be exfiltrated.

Content

Scanner excerpt · scripts/onboarding.py (reported line 195)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 245, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The gateway request path uses urllib to contact a base URL sourced from environment variables while attaching Authorization and other session headers. An attacker who can set the environment can redirect paid-order, account, and package operations to a malicious endpoint and capture credentials or manipulate responses.

Content

Scanner excerpt · scripts/onboarding.py (reported line 247)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
98% confidence
Finding

If the skill advertised as public product research can also trigger account/login, API-key generation, package purchase, and payment flows, that is a materially different and more sensitive behavior surface. Such a mismatch can lead users or agent orchestrators to invoke financial/account operations they did not intend, increasing risk of credential exposure, unauthorized purchases, or deceptive consent bypass.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the skill advertised as public product research can also trigger account/login, API-key generation, package purchase, and payment flows, that is a materially different and more sensitive behavior surface. Such a mismatch can lead users or agent orchestrators to invoke financial/account operations they did not intend, increasing risk of credential exposure, unauthorized purchases, or deceptive consent bypass.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the skill advertised as public product research can also trigger account/login, API-key generation, package purchase, and payment flows, that is a materially different and more sensitive behavior surface. Such a mismatch can lead users or agent orchestrators to invoke financial/account operations they did not intend, increasing risk of credential exposure, unauthorized purchases, or deceptive consent bypass.

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

python scripts/geekbi_temu_category_list.py '{"parentCatId":100}'

text

## Display Rules

1. State the selected marketplace (`regionId`, site name, and currency when available), filters, page, and page size.
2. For search results, show product title, `goodsId`, price range, total/monthly sales, revenue, rating, reviews, inventory, shop, category, status, and listing time when returned.

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 > `pay_ur

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This file implements account onboarding, SMS login, API key retrieval, package purchase, and payment flows, which are unrelated to a Temu/GeekBI product-query skill. That mismatch is dangerous because it introduces hidden credential collection and monetization behavior under a benign data-query skill label, increasing the risk of deceptive operation and unauthorized account actions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script creates orders and generates payment QR codes, which is outside the expected behavior for a product-query skill. This creates a risk of unauthorized or deceptive billing flows, especially because users invoking a data lookup tool would not reasonably expect purchase initiation or payment artifact generation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code logs users in via SMS and then obtains or generates API tokens, enabling privileged access beyond the stated read-only query use case. In the context of a product-data skill, harvesting or minting API keys is highly sensitive and could allow persistent account access, impersonation, or downstream abuse if exposed or misused.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill explicitly describes capabilities that use environment variables, networked API calls, and filesystem writes, yet it does not declare any tool scope or allowed-tools boundary. Missing capability scoping weakens least-privilege controls and makes it harder for a host agent to restrict what the skill may access if the skill instructions are abused or expanded.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file switches into Chinese for invocation guidance and operational instructions, indicating a language expectation for the skill without documenting user opt-in or offering alternatives. This can violate language/locale policy when the skill constrains output or interaction language by default.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Persistent logging of full responses into session-associated directories creates a durable record of queries and returned data that may be accessible to other local processes, users, or later workflows. The danger is amplified because logging is mandatory, full-response by default, and tied to a session identifier, which supports correlation and retention of potentially sensitive business research.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill states that complete API responses are always written to a session-linked local path, but it does not require a user-facing notice or consent about persistence. Even if the data is mostly market data, responses may still contain user-supplied queries, session identifiers, or commercially sensitive research context that persists on disk beyond the immediate task.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file documents reading an API key from environment variables and forwarding headers such as SESSION_ID, MESSAGE_ID, MODE_ID, and APP_NAME to remote endpoints. While the file explains how to call the API, it does not explicitly warn users that these values may contain sensitive credentials or metadata that will be transmitted over the network.

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

所有成对的 *Min 都不得大于对应的 *Max。时间字段仍应始终使用 ISO-8601 date-time;服务端只在同组 Min/Max 同时提供时解析并比较时间,单独提供一个非法时间字符串时可能由上游拒绝。

curl 示例

bash
curl -X POST "${LINKFOX_TOOL_GATEWAY}/geekbi/temu/goodsSearch" \

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

| goodsId | string | 是 | 非空;最大 100 字符 | Temu 商品 ID,通常来自搜索 items[].goodsId | | regionId | integer | 否 | 211;>=1 | Temu 地区 ID;建议与搜索使用同一值 |

curl 示例

bash
curl -X POST "${LINKFOX_TOOL_GATEWAY}/geekbi/temu/goodsDetail" \

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

无业务参数,Body 传 {}。只将非空且为正整数的 sites[].regionId 用于商品搜索和详情;sites[].siteId 是上游内部 ID,不得代替 regionId。如果没有有效 regionId,应停止链式调用并告知用户。

curl 示例

bash
curl -X POST "${LINKFOX_TOOL_GATEWAY}/geekbi/temu/siteList" \

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

品类搜索依赖:先用 {} 获取一级节点;需要下钻时只把非空且为非负整数的 catId 作为下一次请求的 parentCatId;需要筛选商品时只把有效 catId 放入商品搜索的 catIds 数组。如果没有有效 catId,应停止链式调用并告知用户。传 0 合法,但源码没有证明它与省略 parentCatId 等价。

curl 示例

bash
curl -X POST "${LINKFOX_TOOL_GATEWAY}/geekbi/temu/categoryList" \

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation introduces a separate external Feedback API that is outside the stated Temu/GeekBI product-querying scope. This expands the skill's effective capability to transmit data to another service, which can enable unintended exfiltration of user prompts, outcomes, or metadata if an agent uses it automatically without explicit user consent and clear scoping.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The onboarding document expands a product-query skill into account recovery, phone-based registration, API key provisioning, and paid-plan purchase flows that are outside the declared Temu/GreekBI query purpose. This broadens the skill’s authority and creates opportunities for credential handling, billing manipulation, and social-engineering of users into disclosing sensitive information or making purchases.

Content

No source excerpt is available for this finding.