Back to skill

Security audit

TikTok官方-店铺商品

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent TikTok Shop product-management integration, but it needs Review because it can make live store changes and has weak safeguards around gateway trust, broad proxying, and sensitive output.

Install only if you intend to let the agent operate a real TikTok Shop ERP catalog. Verify product IDs, SKU IDs, prices, inventory quantities, listing platforms, and shop context before running mutating commands, and do not use untrusted gateway environment overrides. Treat command output as sensitive because it may contain shop cipher and business data.

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

Error
Location
scripts/_shop_product_common.py:15
Finding

Credential-Bearing Requests Can Be Redirected to an Untrusted or Plaintext Gateway

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 permits the developer-proxy destination to be replaced through either `LINKFOX_TOOL_GATEWAY` or `TIKTOK_SHOP_API_BASE_URL`. The selected URL is used without enforcing HTTPS, validating the hostname, or restricting the port and URL components. Every API request then transmits the following information to the selected destination: - The ...[truncated 2243 chars]
Remediation
View remediation
str: parsed = urlparse(value) if parsed.scheme != "https": raise ValueError("The LinkFox gateway must use HTTPS") if parsed.hostname not in ALLOWED_GATEWAY_HOSTS: raise ValueError("Untrusted LinkFox gateway host") if parsed.username or parsed.password or parsed.query or parsed.fragment: raise ValueError("Invalid gateway URL components") if parsed.port not in (None, 443): raise ValueError("Unexpected gateway port") return value.rstrip("/") ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_product_api_runner.py:224
Finding

Full Shop Cipher and Product Request Data Are Echoed to Standard Output

Content
View full analysis
Remediation
View remediation
str: if len(value) <= 8: return "********" return f"{value[:4]}...{value[-4:]}" ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (41)

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

Critical
Category
Data Flow
Confidence
92% confidence
Finding

The request destination is influenced by environment variables, allowing LINKFOX_TOOL_GATEWAY or TIKTOK_SHOP_API_BASE_URL to redirect authenticated traffic to an arbitrary host. Because the request includes the API key and session metadata headers, a poisoned environment or compromised runtime could exfiltrate credentials and sensitive business data to an attacker-controlled endpoint.

Content

Scanner excerpt · scripts/_shop_product_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
99% confidence
Finding

The declared description presents a business skill for TikTok Shop ERP product management via proxied Product Open API endpoints. However, the provided code chunk only checks whether a required dependency skill (linkfox-tiktok-shop-auth) is installed by scanning environment-derived directories for its SKILL.md file. This is merely a supporting dependency check and does not implement any of the declared product capabilities. Because the actual code's primary behavior is materially different from the declared purpose, this chunk is a mismatch.

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

python scripts/create_product.py '{"openId":"...","requestBody":{...}}'

text

## Display Rules

1. 勿输出完整 `accessToken` / 完整 `shop_cipher` 以外的敏感信息时可掩码 token。
2. 展示 `check_results` 时逐条说明 `check_item` + `fail_reasons`。

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 · references/apis/get_brands.md (reported line 52)May include surrounding context.

md
**- Brand selection rules**: You can only select the following types of brands during product creation/editing.
   * Authorized brands which contain the desired category (`authorized_status=AUTHORIZED` and `brand_status=AVAILABLE`)
   * Unauthorized non-T1 brands (`authorized_status=UNAUTHORIZED` and `is_t1_brand=false`)
      **- Brand display rules**: Note however that brands will only appear on the product display page if the brand is authorized (`authorized_status=AUTHORIZED`) and available in the desired category (`brand_status=AVAILABLE`). This means that you need to obtain brand authorization for unauthorized non-T1 brands before they can be displayed. Obtain brand authorization or add categories to an authorized brand through TikTok Shop Seller Center > Qualification Center > Brand qualification.
      **For Tokopedia sellers**: You can select and display any returned brand on Tokopedia regardless of these rules.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generic run_product_proxy function accepts arbitrary path and method values and forwards them to developer_proxy_call with only minimal validation. This bypasses the allowlisted PRODUCT_ENDPOINTS model used elsewhere, enabling callers to reach undocumented or unintended ERP developerProxy endpoints, potentially including non-product operations or future-added sensitive APIs with the current user's openId context.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documentation describes use of Python scripts, shell execution, environment access, and network calls, but it does not declare any explicit tool scope or permissions boundaries. This creates an overbroad execution surface where an agent may invoke shell/network capabilities without clear least-privilege constraints, increasing the chance of unintended command execution or data exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill advertises destructive product-management operations such as delete, restore, unlist, price change, and inventory updates without an explicit warning or confirmation requirement. In an agent setting, this raises the risk of accidental live-commerce changes that can disrupt listings, pricing, stock, or availability across a real shop.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The usage flow encourages operational scripts for search, create, activate, delete, recover, price, and inventory updates without a safety checkpoint before executing live mutations. In the context of an ERP product skill connected to real store APIs, missing confirmation and environment warnings can lead to unintended catalog deletion, listing status changes, or pricing/inventory corruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented API set includes destructive and business-critical actions such as deactivate, delete, recover, price update, and inventory update, but the reference does not instruct the agent to require explicit user confirmation or warn about irreversible or operational impact. In an agent context, this increases the risk of accidental mass changes, product delisting, stock corruption, or unintended deletions from ambiguous or misinterpreted user requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill's own wrapper/documentation content is written in Chinese while the embedded upstream API content is in English, and there is no indication that Chinese is optional or that the skill is intended only for a Chinese-speaking audience. This creates a language/locale policy concern because users are implicitly forced into a specific language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill's core usage and mapping documentation is written in Chinese, which effectively imposes a language requirement on users of this file. Under the policy, language constraints should either offer user opt-in/choice or be clearly justified as region-specific; neither is present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document says product content must align with the target market language and explicitly gives "don't use Chinese" as an example. This is a natural-language locale policy constraint presented as a hard rule, without offering user opt-in, language selection guidance, or clarifying that the restriction is purely an upstream platform requirement for a specific market context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The text states that product content 'must align with the target market's language' and explicitly says not to use Chinese. This is a natural-language locale policy constraint presented as a mandatory rule, but the document does not frame it as a user choice or clearly justify it as an organizational policy exception beyond platform behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This documentation describes a destructive operational action—deactivating live products and hiding them from buyers—without an explicit warning, confirmation requirement, or guardrail guidance. In an ERP/product-management skill, that omission can lead an agent or user to perform bulk product takedowns that immediately affect storefront availability, sales, and merchant operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file documents an API and script for deleting products, which is a destructive operation affecting user data/system state. While the purpose is clear from the title and method, the document does not include any explicit caution, confirmation requirement, or warning about irreversibility before showing how to invoke it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This is a real safety issue because the skill-specific section presents a full-edit endpoint while not prominently warning that omitted fields can overwrite existing product data and omitted SKU IDs can delete SKUs. In an agentic workflow, a model or user may reasonably treat an edit as partial, causing irreversible catalog corruption, delisting, inventory loss, or cross-market visibility changes when constructing minimal payloads.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file documents an authorization-adjacent API inside a skill whose manifest explicitly says it is product-only and does not include authorization. Even though the API is read-only, it exposes the ability to enumerate a user's authorized shops and obtain shop ciphers, which broadens the skill's effective capability beyond its declared scope and can enable unintended cross-shop access flows in downstream product operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill-specific mapping section introduces a mutating product edit endpoint but does not prominently warn that partial updates can still be destructive when top-level nested objects or SKU arrays are supplied incompletely. Because the API semantics can delete omitted SKUs or blank omitted nested fields, an agent or user relying on the skill-local summary could unintentionally cause data loss or listing corruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation states that listing_platforms controls product visibility and that omitting a platform can deactivate and hide the product there, but this appears deep in the API reference rather than as an upfront operational warning. In an agent skill, this creates a meaningful risk of unintended delisting across TikTok Shop or Tokopedia from a seemingly routine edit request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file states that text fields must align with the target market's language and gives a prescriptive example such as "don't use Chinese." This is a natural-language locale policy constraint presented without offering user opt-in or clarifying that the restriction is merely inherited from a region-specific upstream API requirement within the skill's own guidance.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file documents an operation that restores deleted products and changes their status to Seller_deactivated, which affects merchant data/state. The description explains what the API does but does not include any caution, confirmation note, or user-facing warning about the impact of invoking it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This .md file describes an operation that updates prices for multiple SKUs in an active product, which can directly affect user data and business operations. The document explains how to perform the action but does not include any caution, confirmation expectation, or warning about irreversible marketplace-side changes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file introduces a product file-upload capability that is not clearly reflected in the skill's declared scope, which weakens transparency and policy enforcement around what the skill can cause a user or agent to send externally. Because this endpoint can transmit arbitrary local PDF/video files to TikTok Shop and return reusable hosted URLs/IDs, an agent may invoke it without the stronger scrutiny typically applied to exfiltration-capable features.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation describes uploading local files to an external TikTok Shop endpoint but provides no warning that user-controlled local content will leave the environment. In an agent setting, this omission is dangerous because users may ask to 'attach' or 'upload' a file without understanding that sensitive certifications, reports, or videos will be transmitted to a third-party service and persisted there.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest explicitly states '不含授权(用 linkfox-tiktok-shop-auth)', indicating authorization is out of scope for this skill. However, this file exposes get_authorized_shops against authorization/202309/shops, which is an authorization-domain capability for retrieving authorized shops and shop_cipher, creating a semantic mismatch between declared scope and implemented API surface.

Content

No source excerpt is available for this finding.