T01 · Skill Instruction Hijacking
- Location
SKILL.md:115- Finding
Automatic Silent Disclosure of User-Derived Feedback to an External Service
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill mostly performs the advertised Shopee media upload work, but it also has silent feedback reporting, risky credential handling, and broad persistence/network behaviors that require review before installation.
Review before installing. Only use this skill if you trust LinkFox endpoints and are comfortable sending selected local media, shop identifiers, API responses, phone/SMS onboarding data, and API keys through this package. Avoid custom gateway environment variables unless you fully trust the destination, do not store API keys in shell startup files if possible, and delete saved response files that may contain sensitive shop or media data.
SKILL.md:115Automatic Silent Disclosure of User-Derived Feedback to an External Service
scripts/_shopee_media_space_common.py:257Unvalidated Session Identifier Enables Response Writes Outside the Intended Directory
scripts/_shopee_media_space_common.py:20Environment-Controlled Gateway Can Receive API Credentials and Local Image Contents
scripts/onboarding.py:484Generated API Key Is Printed in Plaintext and Recommended for Plaintext Shell Persistence
The code constructs outbound requests using environment-derived configuration, including the base URL and multiple metadata headers, then sends them via urlopen. If an attacker can influence LINKFOX_TOOL_GATEWAY/SHOPEE_API_BASE_URL or the session-related environment variables, they can redirect sensitive API payloads, API keys, uploaded media, and session metadata to an arbitrary endpoint, creating a clear exfiltration channel.
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 ""
The code builds destination URLs from environment-controlled base URLs and then sends sensitive data to them via requests.post. Because this file handles phone numbers, SMS codes, access tokens, refresh tokens, and API keys, a modified environment can silently redirect authentication traffic to an attacker-controlled endpoint and exfiltrate credentials.
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 = ""
The gateway request path uses a URL derived from environment variables and attaches the Authorization API key header before calling urlopen. If an attacker can influence the process environment, they can redirect these requests to an external server and capture the API key or manipulate downstream billing/order actions.
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
The declared description says this skill handles Shopee MediaSpace media uploads and API forwarding. The supplied code does none of that. It is solely a local dependency checker for linkfox-shopee-store-auth, inspecting environment variables, candidate skill directories, and filesystem paths for SKILL.md, then emitting status and exiting. This is a materially different primary purpose from the declared Shopee media-upload functionality, so it is a clear description-behavior mismatch.
The declared description is specifically about Shopee MediaSpace media upload and proxying Shopee developer API endpoints. The supplied code does none of that: it contains no Shopee endpoints, no media upload logic, no image/video handling, no chunked upload behavior, and no MediaSpace API forwarding. Instead, it is a standalone LinkFox account/environment onboarding and commerce CLI for authentication, package purchase, payment QR rendering, and order lookup. This is a clear primary-purpose mismatch with multiple undeclared capabilities unrelated to Shopee media upload.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- **Base URL**:`https://tool-gateway.linkfox.com`
- **Method**:POST(网关),上游 Method 见各接口
- **Auth**:Header `Authorization: <api_key>`(`LINKFOXAGENT_API_KEY`)(如未配置 按 SKILL.md 的 **## 解决认证和算力问题** 处理)
- **流程**:授权选店后,图片调用 `/shopee/uploadMediaSpaceImage`;其余接口调用 `/shopee/developerProxy`。业务脚本不读取或传递 access token
- **图片上传**:`POST /shopee/uploadMediaSpaceImage`,传 `shopId`、`filePath`(脚本侧)
- **其余 API path**:经 developerProxy,须 `api/v2/media_space/...`
- **标识**:通常传 **`shopId`**
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
示 JSON 里的 phone/agreements
- 收到验证码后:`python scripts/onboarding.py login <phone> <code>`
- 拿到 `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
This skill is declared as a Shopee MediaSpace upload capability, but the file implements a separate LinkFox onboarding, login, API-key issuance, package listing, and payment workflow. That mismatch is dangerous because users or orchestrators may grant or invoke the skill for media-upload tasks while it actually performs credential collection and account monetization actions outside the stated scope.
The file contains order creation, package retrieval, and payment QR generation logic that is unrelated to Shopee media uploads. In the context of a media-upload skill, hidden billing capabilities materially increase the chance of unauthorized purchases, social engineering, or misuse of stored API credentials.
The script performs SMS-based login, refresh/access token handling, group lookup, and API token generation, all of which exceed the declared Shopee media-upload purpose. In a mismatched skill, collecting authentication factors and minting API keys creates a substantial credential theft and account takeover risk if the skill is invoked under false expectations.
The skill advertises shell, network, environment, and file read/write capabilities but declares no explicit tool scope or permission boundaries. In an agent setting, missing scope declarations increase the chance of over-privileged execution, making it easier for the skill to access local files, secrets, or external endpoints beyond what is necessary for Shopee media upload tasks.
The trigger conditions include broad terms like Shopee upload, media_space, image ID/URL, and video upload references, which can cause the skill to activate in contexts broader than intended. Over-broad invocation raises the risk of unintended network calls, file handling, and persistence of sensitive media-related data when the user did not explicitly request this skill.
The skill states that full API responses are always written to project files, potentially including image/video metadata, identifiers, shop information, and other sensitive operational data, without a clear consent or privacy warning. Automatic persistence expands the exposure window for sensitive data and may leak information into repositories, shared workspaces, backups, or later agent context.
The document says the tool consumes compute and may hit quota/balance errors, but later states '不消耗算力' ('does not consume compute'). This contradiction can mislead users or higher-level agents into making repeated calls under false assumptions about cost, potentially causing unexpected charges, throttling, or operational disruption.
At L13, the documentation explicitly states that business scripts do not read or pass an access token. However, the example request at L73-L81 includes an "accessToken" field in the JSON payload, which directly contradicts that claim and could mislead developers about the intended authentication model.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
export KEY=$LINKFOX_AGENT_API_KEY
The documentation explicitly instructs users to read a local image file and send it to a remote API, but it does not clearly warn that local file contents will be uploaded off-device to LinkFox/Shopee infrastructure. This creates a real privacy and data-handling risk because users may accidentally transmit sensitive local files if they misunderstand the operation or provide the wrong path.
The instructions direct the operator to collect a user's phone number and drive a registration/login flow through a local script, but provide no privacy notice, consent guidance, retention limits, or handling safeguards for that personal data. In a support/onboarding context this creates a real risk of unnecessary collection or improper exposure of phone numbers and SMS-based authentication data.
The skill's stated purpose is Shopee media upload and API proxying, but ensure_auth_skill_available spawns a separate Python process to run check_auth_dependency.py. Launching subprocesses is a distinct capability from media handling or API forwarding and is not declared in the manifest description.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
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,
The function reads a local file, base64-encodes its contents, and sends it to a remote upload endpoint. While the operation is inherent to an image-upload helper, this file provides no explicit user-facing warning, confirmation, or explanatory comment near the transmission of local file data.
The developer proxy can forward arbitrary Shopee API paths, request bodies, and environment-derived session metadata to a remote gateway. In context, this is intended functionality, but it is still dangerous because the proxy is broad and can transmit sensitive business data or tokens without narrowing scope to only the MediaSpace operations described by the skill.
The result-emission layer writes full API responses, session identifiers, skill usage, and file metadata to local disk under predictable directories. Because this skill handles store tokens, developer-proxy results, and uploaded media metadata, persisted artifacts may contain sensitive commercial or authentication-related data that outlives the user session and can be accessed by other local processes or users.
The helper persists full responses and metadata to disk, creating a durable data-retention channel independent of the user-visible output. In a skill that brokers store credentials, media uploads, and arbitrary developer-proxy responses, this materially increases the risk of leakage of tokens, shop data, operational history, or sensitive API content.
The file contains natural-language strings in Chinese for the top-level description and the missing-dependency reason, with no indication that the skill is intentionally region-specific or that users can opt into a preferred language. This can violate language/locale policy when a skill imposes one language by default.