Back to skill

Security audit

Temu美国站-上架商品

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly aligned with Temu product API work, but it needs Review because it handles powerful store credentials, payment/account flows, and environment-selected network endpoints with weak scoping.

Install only if you trust LinkFox and need this Temu gateway. Before use, clear or audit LINKFOX_* and TEMU_* endpoint override variables, avoid printing full access tokens, restrict permissions on ~/.linkfox/temu-access-tokens.json, and be careful with scripts that create payment orders or mutate listings, prices, inventory, or sensitive product attributes.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_temu_token_store.py:31
Finding

Temu access tokens are stored and disclosed in plaintext

Content
View full analysis
None: path = store_path() parent = os.path.dirname(path) if parent: os.makedirs(parent, exist_ok=True) with open(path, "w", encoding="utf-8") as f: json.dump(data, f, indent=2, ensure_ascii=False) f.write("\n") ``` `scripts/_temu_token_store.py:62-68`: ```python entry = { "site": site, "managementType": management_type, "tokenPurpose": token_purpose, "accessToken": access_token, "updatedAt": _utc_now(), } ``` `scripts/get_temu_access_token.py:51-60`: ```python print( json.dumps( { "found": True, "storeKey": store_key, "site": site, "managementType": management_type, "tokenPurpose": token_purpose, "accessToken": token, }, indent=2, ensure_ascii=False, ) ) ``` ### Technical Analysis The Skill stores Temu access tokens as unencrypted JSON in `~/.linkfox/temu-access-tokens.json`, or at a path supplied through `TEMU_TOKEN_STORE_PATH`. The file is created with the process's default umask rather than an explicitly restrictive mode such as `0600`. The implementation does not: - Use an operating-system credential manager or encrypted secret store. - Explicitly restrict file permissions. - Validate file ownership. - Reject symbolic links before writing. - Perform an atomic, permission-preserving replacement. - Prevent the complete token from being printed to stdout. The retrieval command prints the full access token rather than returning a masked value. ...[truncated 2567 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_temu_common.py:15
Finding

Environment-controlled API endpoints can receive production credentials without origin validation

Content
View full analysis
dict: """调用 Temu 网关接口;必须先具备 LinkFox 用户 Token。""" linkfox_token = get_linkfox_token(linkfox_params) data = json.dumps(body, ensure_ascii=False).encode("utf-8") req = Request( url, data=data, headers=build_gateway_headers(linkfox_token), method="POST", ) try: with urlopen(req, timeout=timeout) as response: return json.loads(response.read().decode("utf-8")) ``` `scripts/onboarding.py:68-85`: ```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 _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") ``` ### Technical Analysis The API proxy and onboarding endpoints can be replaced through environment variables. The replacement URL is accepted without validating: - The URL scheme. ...[truncated 3704 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (72)

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

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The POST destination is derived from environment-controlled base URLs and the request carries sensitive data including phone numbers, SMS codes, access tokens, refresh tokens, and generated API keys. If an attacker can influence environment variables in the runtime, they can redirect these requests to attacker-controlled hosts and exfiltrate credentials or payment-related data. The mismatch between this onboarding/login flow and the stated Temu product-publishing purpose increases suspicion because the code introduces unnecessary credential-handling and outbound auth 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
95% confidence
Finding

The gateway URL is built from environment-controlled configuration and used in urlopen with an Authorization header containing the agent API key. An attacker who can set or poison these environment variables can redirect authenticated gateway calls, capture API keys, and manipulate account, package, order, or billing operations. In this skill, that risk is more serious because the code performs unrelated account and purchase actions rather than narrowly scoped Temu add-product operations.

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

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A file-download helper that can potentially fetch arbitrary caller-specified URLs through a signed gateway can become a proxy for unauthorized data retrieval or SSRF-like access patterns. In an agent context, this is more dangerous because the model may be induced to fetch sensitive resources indirectly.

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

This file implements SMS login, API-key retrieval, subscription browsing, order creation, payment QR generation, and order querying, which are unrelated to a Temu US add-product skill. That functional mismatch is a strong indicator of deceptive scope: users invoking a product-publishing integration could be funneled into credential capture and billing workflows they did not expect. The hostile context materially increases risk because the code handles authentication and monetization outside the declared purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill contains billing and payment functionality, including package selection, order creation, and QR-code payment rendering, despite being described as a Temu product-publishing integration. Unjustified payment capabilities can be used to socially engineer users into purchases, trigger unauthorized charges, or normalize collection of sensitive account/payment state under a false pretense. In context, the discrepancy between declared and actual behavior makes this especially dangerous.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares network, environment-variable, and file-write behavior but does not declare any tool scope or permission boundaries. In an agent setting, undocumented capabilities increase the chance of unintended credential access, disk persistence, or external calls beyond user expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states that complete API responses are always written to project-local disk, but this is not surfaced as a prominent warning in the skill description or permission model. Because responses may contain access tokens, account details, product data, or other sensitive content, users and downstream tools may be exposed unexpectedly.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.