Back to skill

Security audit

Temu美国站-取消订单

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does what it says, but it gives a cancellation workflow broader Temu API reach and handles credentials and retained order data too loosely.

Review before installing. Use this only in a controlled workspace, provide the narrowest Temu token possible, avoid passing raw tokens through chat or logs, verify gateway environment variables point only to the intended LinkFox HTTPS host, and manually confirm any cancellation, payment, or non-cancellation proxy call.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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

Warning
Location
scripts/_temu_token_store.py:27
Finding

Temu access tokens are stored and exposed 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") ``` ```python entry = { "site": site, "managementType": management_type, "tokenPurpose": token_purpose, "accessToken": access_token, "updatedAt": _utc_now(), } ``` The token retrieval command returns the complete secret: ```python print( json.dumps( { "found": True, "storeKey": store_key, "site": site, "managementType": management_type, "tokenPurpose": token_purpose, "accessToken": token, }, indent=2, ensure_ascii=False, ) ) ``` The token-listing command also permits callers to disable masking: ```python mask = True if len(sys.argv) >= 2: try: params = json.loads(sys.argv[1]) mask = params.get("mask", True) except json.JSONDecodeError as e: print(f"Invalid parameter format: {e}", file=sys.stderr) sys.exit(1) print(json.dumps(list_stores(mask=mask), indent=2, ensure_ascii=False)) ``` ### Technical Analysis Temu seller access tokens are written directly to a JSON file without encryption and without explicitly enforcing owner-only permissions on the parent directory or file. File accessibility consequently depends on the process umask and any pre-existing filesystem permissions. The retrieval utility always prints the raw access token to standard output. The listing utility masks ...[truncated 1617 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_temu_common.py:307
Finding

Complete API responses are retained without explicit access controls or retention limits

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 fallback = os.path.abspath(candidates[-1]) _LF_SESSION_CACHE["_root"] = fallback return fallback ``` ```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)}.js ...[truncated 2119 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/temu_us_proxy.py:23
Finding

Generic Temu proxy permits API operations outside the declared cancellation scope

Content
View full analysis
'", file=sys.stderr) sys.exit(1) params = load_json_arg(sys.argv) params.setdefault("site", DEFAULT_SITE) api_type = require_text(params, "type") result = parse_nested_body(us_proxy_call(params, api_type)) emit_result(result, inline=lf_inline_flag()) ``` ```python def build_us_proxy_body(params: dict, api_type: str, business=None) -> dict: site = str(params.get("site", DEFAULT_SITE)).strip().lower() or DEFAULT_SITE management_type = ( str(params.get("managementType", DEFAULT_MANAGEMENT_TYPE)).strip().lower() or DEFAULT_MANAGEMENT_TYPE ) if "tokenPurpose" not in params and params.get("storeKey") and not params.get("accessToken"): params = dict(params) params.setdefault("tokenPurpose", DEFAULT_TOKEN_PURPOSE) params.setdefault("site", site) params.setdefault("managementType", management_type) body = { "site": site, "managementType": management_type, "accessToken": resolve_access_token(params), "type": api_type, } biz = business if business is not None else extract_business_params(params) if biz: body["params"] = biz return body ``` ### Technical Analysis The Skill is described primarily as a Temu US cancellation integration covering six named API operations. The fixed-operation scripts hardcode their intended API method, but `temu_us_proxy.py` accepts an arbitrary caller-controlled `type` and forwards it to the LinkFox gateway. No client-side allowlist limits `type` to the six cancellation methods: - `bg.aftersales.cancel.list.get` - `bg.aftersales.cancel.agree` - `temu.order. ...[truncated 1403 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_temu_common.py:15
Finding

Environment-controlled gateway override can redirect LinkFox and Temu credentials

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")) ``` The transmitted headers include the LinkFox credential: ```python def build_gateway_headers(linkfox_token: str) -> dict: """网关鉴权:Authorization(全站通用)+ Token(TEMU_API_SPEC 约定)。""" return { "Authorization": linkfox_token, "Token": linkfox_token, "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/1.0", } ``` ### Technical Analysis Three environment variables can replace the documented LinkFox gateway with an arbitrary base URL. The code does not enforce HTTPS, validate the hostname, or require explicit confirmation before sending credentials to an overridden destination. Normal proxy request bodies contain the Temu access token, while request headers contain the LinkFox API key twice. Therefore, a malicious or accidentally poisoned runtime environment can redirect both credentials and business request data to another se ...[truncated 1120 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (57)

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 builds request destinations from environment variables such as LINKFOX_LOGIN_API_URL and LINKFOX_AGENT_USER_API_URL, then sends SMS-login data, access tokens, refresh tokens, and generated API tokens to those endpoints via requests.post. In a skill/runtime environment where environment variables can be influenced by deployment or a malicious wrapper, this enables credential exfiltration and SSRF to attacker-controlled hosts.

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

The gateway URL is derived from environment-controlled base settings and then used by urllib.request.urlopen with the Authorization header populated from the API key. If an attacker can alter the runtime environment, requests intended for LinkFox can be redirected to arbitrary internal or external systems, leaking credentials and enabling SSRF against reachable network targets.

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

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Undeclared file download behavior and use of a separate fileDownload endpoint create a manifest-to-behavior mismatch that weakens user consent and security policy enforcement. Even if the function is legitimate, hidden data retrieval in a transactional order-cancellation skill increases the chance of misuse or accidental data handling outside expectations.

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

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script prints the raw access token in JSON to stdout, creating a direct credential-disclosure primitive. In agent or automation environments, stdout is often logged, forwarded, or surfaced to users and other components, so this can immediately expose a reusable bearer token that grants API access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file implements an onboarding and payment CLI for LinkFox accounts, but the declared skill is for Temu US order cancellation APIs. This strong mismatch indicates hidden or substituted behavior: a user invoking a commerce-cancellation skill could instead be led into login, token issuance, and purchasing flows, which is dangerous because the skill context lowers user suspicion.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This section lists purchasable plans, creates payment orders, and renders QR codes for payment, none of which are necessary for canceling Temu orders. Embedding payment-generation behavior inside an unrelated operational skill creates a phishing/fraud vector and may trick users into purchasing services under false pretenses.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file implements a signed file download capability inside a skill whose declared purpose is cancel-order operations. That mismatch is dangerous because it expands the skill's effective capability surface beyond what operators and users expect, enabling unauthorized file retrieval through the LinkFox/Temu gateway under misleading packaging. In a commerce integration context, hidden download functionality can be used to exfiltrate signed resources or bypass review assumptions tied to the skill's stated purpose.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents capabilities that use environment variables, persistent file writes, and outbound network access, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, missing scope declarations weakens least-privilege controls and increases the chance the skill is invoked with broader powers than users expect.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Conflicting statements about whether the skill consumes credits are primarily a trust and UX problem, but they can still cause harmful automated behavior, such as repeated invocations under false assumptions about cost. In agent systems, inaccurate cost semantics can drive unsafe retry logic or user-consent failures.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly persists full API responses to the current project directory, which may contain order, aftersales, or credential-adjacent sensitive data, without clear consent or warnings. In an agent workspace, writing such data into shared repositories or long-lived directories increases the risk of accidental exposure, retention, indexing, or check-in to version control.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation presents a six-endpoint cancellation skill but also includes local token-management and authorization helper scripts, expanding the effective scope beyond what the manifest advertises. This creates a documentation integrity problem that can mislead users, reviewers, and automated routing into granting trust to a broader toolset than intended.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

Self-contradictory credit-consumption guidance can mislead both users and automation about when retries or additional queries are acceptable. While not a direct exploit primitive, such inconsistencies weaken informed consent and can create billing or abuse-management issues.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation explicitly recommends storing a sensitive Temu access token on disk in a predictable local file path, but it does not include concrete safeguards such as filesystem permission requirements, encryption, rotation guidance, or warnings against committing the file to source control. If the local machine is compromised, shared, backed up insecurely, or the token store is exposed, an attacker could reuse the token to access Temu business APIs and perform unauthorized order or store operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This README documents multiple cancel-order and cancel-related API operations, including agreeing to cancellation and out-of-stock cancellation flows, but it provides no warning that these actions may change order state or affect merchants/buyers. For markdown files, safety-relevant descriptions should disclose behaviors that could affect user data or system integrity; cancellation operations are potentially irreversible or business-impacting.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.