Back to skill

Security audit

Temu全球站-合规

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to support Temu compliance workflows, but it also handles commerce credentials, local token storage, full response persistence, endpoint overrides, and billing actions in ways that need careful review.

Install only if you trust LinkFox with the relevant Temu and LinkFox credentials and are comfortable with local plaintext token files, persisted full API responses, and user-directed billing/order flows. Use a dedicated least-privilege Temu token, avoid custom gateway environment variables unless you control the endpoint, review files written under linkfox directories, and do not expose command output or token-store files in logs or shared workspaces.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_temu_token_store.py:29
Finding

Temu access tokens are stored in plaintext without enforced restrictive permissions

Content
View full analysis
str: return os.environ.get("TEMU_TOKEN_STORE_PATH", DEFAULT_STORE_PATH) ``` ```python def _save_store(data: dict) -> 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") ``` ```python entry = { "site": site, "managementType": management_type, "tokenPurpose": token_purpose, "accessToken": access_token, "updatedAt": _utc_now(), } ``` ### Technical Analysis The token store persists complete Temu access tokens as unencrypted JSON. The code creates the parent directory and output file without explicitly setting owner-only permissions. Consequently, the effective permissions depend on the process umask and preexisting directory or file permissions. On a multi-user host, shared development environment, CI worker, or machine running untrusted local processes, the file may be readable by principals that should not have access to the Temu account. The `TEMU_TOKEN_STORE_PATH` override also permits storage in locations with weaker access controls. There is no use of an operating-system credential manager, encryption at rest, atomic replacement, symlink protection, or validation that the destination is a regular owner-controlled file. ### Attack Path 1. A user saves a Temu token using `save_temu_access_token.py`. 2. `_save_store()` writes the complete token to `~/.linkfox/temu-access-tokens.json`, or to a path selected through `TEMU_TOKEN_STORE_PATH`. 3. The host's umask or existing filesystem permissions allow an ...[truncated 581 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/get_temu_access_token.py:48
Finding

Stored Temu access tokens are disclosed in full through standard output

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_temu_common.py:15
Finding

Environment-controlled gateway URLs can exfiltrate LinkFox and Temu credentials

Content
View full analysis
dict: """网关鉴权:Authorization(全站通用)+ Token(TEMU_API_SPEC 约定)。""" return { "Authorization": linkfox_token, "Token": linkfox_token, "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/1.0", } ``` ```python def call_temu_api( url: str, body: dict, timeout: int = 150, linkfox_params=None, ) -> 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")) ``` The request body constructed by `scripts/_temu_global_common.py:49-55` includes the Temu token: ```python body = { "site": site, "managementType": management_type, "accessToken": resolve_access_token(params), "type": api_type, } ``` ### Technical Analysis The gateway destination can be replaced through three environment variables. The selected URL is not validated for scheme, hostname, port, credentials in the authority component, or trust relationship. The request nevertheless carries the LinkFox API credential in both `Authorization` and `Token` headers. Normal proxy ca ...[truncated 1459 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_temu_common.py:210
Finding

Unsanitized SESSION_ID permits output path traversal

Content
View full analysis
str: env = os.environ.get("SESSION_ID") if env: return env.strip() if "_auto" not in _LF_SESSION_CACHE: _LF_SESSION_CACHE["_auto"] = ( _lf_time.strftime("%H%M%S", _lf_time.localtime(ts)) + "-" + _lf_secrets.token_hex(3) ) return _LF_SESSION_CACHE["_auto"] ``` ```python sid = _lf_session_id(ts) root = _lf_root() session_dir = os.path.join(root, date_str, sid) os.makedirs(session_dir, exist_ok=True) _lf_ensure_meta(root, session_dir, date_str, sid, ts) data_dir = os.path.join(session_dir, "data") os.makedirs(data_dir, exist_ok=True) out = os.path.join(data_dir, f"{slug}-{int(ts * 1_000_000)}.json") try: with open(out, "w", encoding="utf-8") as f: f.write(serialized) ``` The onboarding implementation repeats the same trust boundary: ```python def session_dir() -> str: ts = time.time() sid = (os.environ.get("SESSION_ID") or "").strip() or ( time.strftime("%H%M%S", time.localtime(ts)) + "-" + secrets.token_hex(3)) path = os.path.join(_linkfox_root(), time.strftime("%Y-%m-%d", time.localtime(ts)), sid) os.makedirs(path, exist_ok=True) return path ``` ### Technical Analysis `SESSION_ID` is incorporated directly into a filesystem path without validating path separators, absolute paths, `..` components, or the resolved destination. In Python, an absolute final component passed to `os.path.join()` discards preceding components. Relative traversal components can also escape the intended date and LinkFox output directories. The process subsequently creates directories and writes metadata, API responses, or payment QR images at the resulting location. The generated resp ...[truncated 1320 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_temu_common.py:179
Finding

Sensitive API responses can silently fall back to system temporary storage

Content
View full analysis
str: cached = _LF_SESSION_CACHE.get("_root") if cached: return cached candidates = [] acpx = (os.environ.get("ACPX_WORKSPACES") or "").strip() if acpx: acpx = acpx.split(os.pathsep)[0].strip() if acpx: candidates.append(os.path.join(acpx, "linkfox")) candidates.append(os.path.join(os.getcwd(), "linkfox")) candidates.append(os.path.join(os.path.expanduser("~"), "linkfox")) candidates.append(os.path.join(_lf_tempfile.gettempdir(), "linkfox")) for root in candidates: try: os.makedirs(root, exist_ok=True) probe = os.path.join(root, ".write_probe") with open(probe, "w", encoding="utf-8") as f: f.write("") os.remove(probe) except OSError: continue root = os.path.abspath(root) _LF_SESSION_CACHE["_root"] = root return root ``` The complete response is subsequently written by `scripts/_temu_common.py:307-323`: ```python def emit_result(result, slug=SLUG, inline=False): """落盘完整响应到 linkfox///data/-.json;大响应只打印摘要。无缓存。""" serialized = json.dumps(result, ensure_ascii=False, indent=2) ts = _lf_time.time() date_str = _lf_time.strftime("%Y-%m-%d", _lf_time.localtime(ts)) sid = _lf_session_id(ts) root = _lf_root() session_dir = os.path.join(root, date_str, sid) os.makedirs(session_dir, exist_ok=True) _lf_ensure_meta(root, session_dir, date_str, sid, ts) data_dir = os.path.join(session_dir, "data") os.makedirs(data_dir, exist_ok=True) out = os.path.join(data_dir, f"{slug}-{int(ts * 1_000_000)}.json") try: with open ...[truncated 1748 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 (69)

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

Critical
Category
Data Flow
Confidence
94% confidence
Finding

The script builds request destinations from environment-controlled base URLs and then sends sensitive authentication material, including SMS login data, access tokens, refresh tokens, and generated API keys, to those endpoints. If an attacker can influence environment variables in the host or workspace, they can redirect these requests to attacker-controlled infrastructure and exfiltrate credentials or payment-related data.

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

The gateway request path uses an environment-derived base URL and attaches the LinkFox API key in the Authorization header before calling urlopen. An attacker who controls the environment can redirect gateway traffic to a malicious server and capture API credentials, user/account metadata, and order 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

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the skill returns authorization guidance and onboarding flows instead of performing the claimed compliance forwarding, users may be induced to provide credentials or follow workflows they did not intend to invoke. The risk is chiefly trust-boundary confusion and accidental secret exposure caused by misleading packaging.

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 file implements LinkFox account onboarding, SMS login, API key minting, package listing, and payment flows, which are materially unrelated to a Temu Global compliance skill. That scope mismatch is dangerous because it can trick users or the hosting agent into performing credential collection and billing actions under the cover of an unrelated compliance integration.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill contains order creation, payment URL handling, and QR-code rendering for package purchases, none of which are necessary for Temu compliance operations. In this context, hidden billing capability increases the risk of unauthorized purchases, deceptive monetization, and abuse of the agent as a payment facilitator.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code performs SMS-based authentication, obtains access and refresh tokens, queries user/team information, and generates or retrieves API tokens, all outside the declared Temu compliance purpose. In the skill context, this is particularly dangerous because it enables credential harvesting and long-lived token acquisition under a misleading manifest.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares capabilities that involve environment access, filesystem writes, and network use, but it does not declare a restrictive tool scope such as permissions or allowed-tools. In a skill that can handle authentication material and remote API calls, this ambiguity increases the risk of over-privileged execution and unintended access to secrets or local files.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation text says the skill triggers when users mention a long mixed list including broad topic phrases such as "Temu Global 合规", "商品资质", and "资质上传". These phrases can arise in general discussion and the file does not provide exclusion conditions or negative examples to clarify when the skill should not activate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill name and descriptive instructions are written entirely in Chinese for a Global compliance tool, with no indication that users may interact in another language or choose their preferred locale. This can constitute a language/locale policy issue because the file imposes a single language experience without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Contradictory statements about whether the tool consumes points can manipulate user decision-making and defeat informed consent about paid operations. While not a code-execution flaw, it is a security-relevant trust issue because users may approve actions under false cost assumptions.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs that full API responses must always be written under the working directory and sometimes fully printed to stdout. In a compliance context, those responses may contain sensitive seller, product, document, or credential-adjacent data, and writing them to project directories or logs creates a strong risk of accidental disclosure, retention, and secondary access by other tools or users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document explicitly recommends saving a Temu access token to a local file path and shows command examples containing raw token material, but it does not warn about file permissions, encryption, shell history leakage, backups, multi-user systems, or secret rotation. Because this skill handles real commerce credentials, insecure local storage can lead to credential theft and unauthorized API access if the workstation, home directory, logs, or backups are exposed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This is a markdown file, so SQP-2 applies to omissions in the skill description. The file clearly instructs users to upload qualification documents via a remote gateway and includes sensitive fields such as accessToken, fileUrl, authCode, and product images, yet it does not warn about privacy, external transmission, or the need to verify document contents before upload.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/temu_proxy.py:7