Back to skill

Security audit

TikTok官方-店铺订单

Security checks for vulnerabilities and agentic risk

Overview

The skill is mainly for TikTok Shop order lookups, but it exposes broader authenticated proxy behavior and an unvalidated configurable gateway that could send credentials and order data outside the narrow advertised scope.

Review before installing in any production or seller-account environment. Use only trusted gateway settings, do not override LINKFOX_TOOL_GATEWAY or TIKTOK_SHOP_API_BASE_URL unless the destination is controlled and HTTPS, restrict the LinkFox API key to the minimum seller/order scope, and avoid using order_proxy.py for anything beyond documented order reads. Treat order responses as sensitive customer/business data and redact buyer contact, address, payment, and identifiers unless specifically needed by an authorized user.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/_shop_order_common.py:15
Finding

Configurable Gateway Can Receive API Credentials and Sensitive Commerce Metadata

Content
View full analysis
str: key = os.environ.get("LINKFOX_AGENT_API_KEY") or os.environ.get("LINKFOXAGENT_API_KEY") if not key: print("API Key 未配置", file=sys.stderr) sys.exit(1) return key def call_api(endpoint: str, params: dict) -> dict: api_key = get_api_key() data = json.dumps(params).encode("utf-8") req = Request( endpoint, data=data, headers={ "Authorization": api_key, "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/1.0", "SESSION_ID": os.environ.get("SESSION_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: return json.loads(response.read().decode("utf-8")) except HTTPError as e: body = e.read().decode("utf-8") if e.fp else "" return {"error": f"HTTP {e.code}: {e.reason}", "details": body} except URLError as e: return {"error": f"Connection failed: {e.reason}"} ``` ### Technical Analysis The Skill must transmit authenticated requests to the declared LinkFox gateway to provide its intended functionality. However, the destination can be replaced through either `LINKFOX_TOOL_GATEWAY` or `TIKTOK_SHOP_API_BASE_URL` without validating the URL scheme or hostname. Every request to the resulting endpoint includes: - The LinkFox API key in the `Authori ...[truncated 1918 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/_order_api_runner.py:258
Finding

Generic Authenticated Proxy Exceeds the Declared Read-Only Order Scope

Content
View full analysis
None: normalized = path.lstrip("/").replace("\\", "/") if ".." in normalized or "//" in normalized: print(f"Error: invalid path {path!r}", file=sys.stderr) sys.exit(1) if not any( normalized == prefix or normalized.startswith(prefix + "/") for prefix in ALLOWED_PATH_PREFIXES ): print( f"Error: path must start with one of {ALLOWED_PATH_PREFIXES}, got {path!r}", file=sys.stderr, ) sys.exit(1) ``` The generic proxy accepts a caller-controlled method, path, query string, content type, and body: ```python def run_order_proxy(params: dict, caller: str = "order_proxy.py") -> dict: """Generic proxy: path + method + openId (+ optional shop_cipher).""" if not params.get("skipDepCheck"): ensure_auth_skill_available(caller) path = params.get("path") method = params.get("method") if not path or not method: print("Missing required fields: path, method", file=sys.stderr) sys.exit(1) open_id = require_open_id(params) shop_cipher = None needs_cipher = str(path).lstrip("/").startswith("order/") if needs_cipher: shop_cipher = resolve_shop_cipher(params, open_id) query_string = params.get("queryString") if shop_cipher: # ensure shop_cipher present pairs = dict(parse_qsl(str(query_string or "").lstrip("?"), keep_blank_values=True)) pairs["shop_cipher"] = shop_cipher query_string = urlencode(pairs) body = params.get("body") if body is not None and not isinstance(bo ...[truncated 3950 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (28)

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The request destination is derived from environment-controlled base URL values, and the code sends a sensitive Authorization API key plus session metadata to that endpoint. If an attacker can influence environment variables in the runtime or deployment, they can redirect requests to an attacker-controlled host and exfiltrate credentials and identifiers via SSRF-style outbound requests.

Content

Scanner excerpt · scripts/_shop_order_common.py (reported line 84)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
94% confidence
Finding

The declared scope says the skill supports specific order APIs, but the presence of generic order/* proxying means additional order endpoints could be reached beyond the reviewed list/detail operations. Generic forwarding substantially increases attack surface because future or undocumented endpoints may permit sensitive reads or state-changing operations that were not intended here.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared scope says the skill supports specific order APIs, but the presence of generic order/* proxying means additional order endpoints could be reached beyond the reviewed list/detail operations. Generic forwarding substantially increases attack surface because future or undocumented endpoints may permit sensitive reads or state-changing operations that were not intended here.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared scope says the skill supports specific order APIs, but the presence of generic order/* proxying means additional order endpoints could be reached beyond the reviewed list/detail operations. Generic forwarding substantially increases attack surface because future or undocumented endpoints may permit sensitive reads or state-changing operations that were not intended here.

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

python scripts/order_api.py '{"api":"get_order_list","openId":"...","page_size":20}'

text

## Display Rules

1. 勿输出完整 accessToken。
2. 列表展示订单号、状态、金额、创建/更新时间等关键字段;细节从 detail 再取。

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

run_order_proxy accepts arbitrary path and method values and forwards them to developer_proxy_call with ERP credentials, only auto-detecting whether a shop_cipher should be injected for order/ paths. That bypasses the skill’s declared scope of only order list/detail APIs and creates a confused-deputy capability where a caller can reach other ERP Open API endpoints through this skill.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill exposes shell, network, and environment-backed capabilities through documented scripts and proxy behavior, but it does not declare any explicit tool scope such as allowed-tools or permissions. This weakens isolation and reviewability: an agent may invoke broader local or network actions than a caller expects, increasing the blast radius if the skill is misused or later modified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language content of the skill is entirely in Chinese and does not indicate that users may interact in other languages or choose their preferred locale. Under the stated policy, forcing a specific language without user opt-in is a reportable natural-language policy issue unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file documents and maps an authorization-discovery API (authorization/202309/shops) inside a skill whose declared scope is limited to order operations and explicitly says it does not include authorization. That scope mismatch can enable unintended capability exposure, allowing callers to enumerate authorized shops and obtain shop cipher values that may be used as inputs to other shop-scoped APIs, weakening least-privilege boundaries.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Labeling the forwarding mapping as part of '本 skill' creates an implementation-level signal that this order skill owns or may invoke an authorization endpoint, despite the manifest explicitly excluding authorization. In agent/tooling environments, such contradictory documentation can cause automatic routing or operator misuse, resulting in privilege creep and unauthorized shop-discovery access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation describes an API that returns highly sensitive order and customer data, including recipient address details, phone number, buyer identifiers, payment metadata, and other order attributes, but provides no privacy, minimization, masking, or access-control guidance. In a skill context, this increases the chance that downstream agents or operators will request, display, log, or persist unnecessary personal data, leading to privacy breaches or unauthorized disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation describes an API that returns detailed order data including recipient name, full address, phone number, buyer identifiers, payment metadata, and other sensitive order attributes, but it provides no privacy, minimization, masking, or access-control guidance for downstream handling. In a reusable agent skill, this omission increases the risk that callers will over-fetch, expose, log, or display personal data without need, especially because the skill is positioned for broad ERP order lookups.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This API documentation describes retrieval of order data that includes buyer-linked information such as address details, phone number, recipient name, buyer message, and other order metadata, but it does not warn downstream skill users or implementers about the privacy sensitivity of that data. In an agent-skill context, omission of privacy guidance increases the chance that assistants will over-fetch, expose, summarize, or log personal data without necessity, creating avoidable confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The response schema and sample enumerate additional sensitive buyer identifiers and profile-related fields, including anonymized email, buyer nickname, buyer avatar, consultation-related identifiers, address information, and other order-linked personal data, yet the document gives no warning about handling or display restrictions. In this skill context, that omission is more dangerous because an LLM-integrated ERP skill may automatically surface these fields to users or store them in traces, broadening exposure of personal and potentially regulated data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

resolve_shop_cipher performs an internal call to authorization/202309/shops to discover shop ciphers, even though the skill metadata says authorization is not part of this skill. While this is used as a dependency helper rather than exposing full auth flows, it still expands the skill’s effective privilege/scope beyond its declared behavior and could leak shop inventory metadata or enable unintended cross-skill access patterns.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest says this skill is for TikTok Shop ERP order APIs, specifically Get Order List and Get Order Detail, and explicitly says authorization should be handled by a separate linkfox-tiktok-shop-auth skill. However, this registry exposes get_authorized_shops, which is an authorization-related shop enumeration capability rather than an order read operation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest describes an ERP order retrieval skill that depends on a separate auth skill, but this helper enforces that dependency by launching a local Python script via subprocess. Spawning a subprocess is a materially broader capability than simple order-list/detail API access and is not explicitly part of the skill's stated purpose.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/_shop_order_common.py (reported line 41)May include surrounding context.

python
print(f"DEPENDENCY_MISSING: {json.dumps(payload, ensure_ascii=False)}", file=sys.stderr)
        sys.exit(DEPENDENCY_EXIT_CODE)
    try:
        result = subprocess.run(
            [sys.executable, str(checker)],
            capture_output=True,
            text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The helper builds and sends an HTTP POST request that includes request params plus SESSION_ID, MODE_ID, and APP_NAME headers, which may carry user or system context. There is no confirmation prompt, user-facing warning, or explanatory comment near the transmission describing that this metadata is sent to an external gateway.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest says this skill is for TikTok Shop ERP order operations limited to Get Order List and Get Order Detail, and explicitly says it does not include authorization. This script instead invokes a separate operation named "get_authorized_shops" to retrieve shops[].cipher, which is a shop-selection/authorization-support capability rather than an order list/detail operation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script accepts an arbitrary api value from JSON input and passes it directly into a generic dispatcher, while the skill metadata says the skill should only support Get Order List and Get Order Detail. This creates a scope-expansion risk: if _order_endpoints or run_order_api expose additional registered order APIs, a caller may invoke unintended capabilities and access or manipulate data beyond the documented contract.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The docstring describes the module as a "generic registered API caller," which signals and reinforces a broader capability model than the manifest advertises. On its own this is documentation drift, but in context it corroborates the actual generic dispatch behavior and increases the likelihood that maintainers or integrators will treat the skill as a general order API proxy, enabling misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file documents API usage that sends openId, shop_cipher, and order query/details to a remote gateway and upstream TikTok API. While the behavior is functionally described, there is no explicit warning about handling potentially sensitive seller/order data or reminding users to avoid exposing customer data in logs or shared outputs.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The run_order_proxy docstring says "Generic proxy: path + method + openId (+ optional shop_cipher)." In practice, when the path starts with order/, the function requires or resolves shop_cipher automatically and forcibly injects it into the query string. This documentation understates and partially contradicts the actual behavior of the proxy helper.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The stderr message "API Key 未配置" is hard-coded in Chinese with no apparent user language choice or fallback. A fixed locale in user-facing output can violate organizational language policy when the skill does not explicitly opt users into that language or document the locale constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.