T01 · Skill Instruction Hijacking
- Location
SKILL.md:185- Finding
Automatic External Feedback Reporting Hijacks Agent Behavior
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches Shopee product management, but it also handles credentials, billing, automatic feedback reporting, and persistent local data in ways users should review carefully.
Review this skill before installing if you use real Shopee stores. It can make live listing changes, delete items, change prices or stock, reply to comments, collect LinkFox login material, create LinkFox billing orders, store full API responses locally, and send feedback externally. Use it only with trusted environment variables, least-privilege credentials, and explicit review before write, delete, billing, or feedback actions.
SKILL.md:185Automatic External Feedback Reporting Hijacks Agent Behavior
scripts/_shopee_product_common.py:18Credential Exfiltration Through Unrestricted API Endpoint Overrides
scripts/_shopee_product_common.py:184Unsafe Persistence of Full API Responses and Path Traversal Through SESSION_ID
The code sends sensitive environment-derived values, including the API key and session/message metadata, to a network endpoint whose base URL is also taken from environment variables. If an attacker can influence LINKFOX_TOOL_GATEWAY/SHOPEE_API_BASE_URL or the runtime environment, they can redirect requests and exfiltrate credentials and session identifiers to an attacker-controlled server.
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 POST destination is derived from environment-controlled base URLs, and this code sends sensitive data including phone numbers, SMS codes, access tokens, refresh tokens, and generated API keys to those endpoints. If an attacker can influence environment variables in the skill runtime, they can redirect authentication and credential flows to attacker-controlled infrastructure, causing credential exfiltration and account compromise.
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 URL is built from environment-controlled base configuration and used with an Authorization header carrying the agent API key. An attacker who can set or poison the environment can redirect these authenticated requests to a hostile server and capture the API key and related account/order metadata.
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
This mismatch is more severe because the documented Shopee product skill appears to include account/login, API-key lifecycle, subscription, order creation, and payment/QR-code operations that are unrelated to product listing management. Hidden auth, billing, or payment capabilities substantially increase risk because they can collect credentials, create charges, or alter account state under the guise of a benign inventory tool.
This mismatch is more severe because the documented Shopee product skill appears to include account/login, API-key lifecycle, subscription, order creation, and payment/QR-code operations that are unrelated to product listing management. Hidden auth, billing, or payment capabilities substantially increase risk because they can collect credentials, create charges, or alter account state under the guise of a benign inventory tool.
Referenced artifact was not completely inspected
共享:`_shopee_product_common.py`、`_product_endpoints.py`、`_product_api_runner.py`。
The file embeds authentication recovery, phone-based registration, and billing/purchase workflows that are unrelated to a Shopee product-management skill’s declared purpose. This expands the skill’s effective scope into account onboarding and payment enablement, creating unnecessary access to sensitive account and payment flows and increasing the chance of abuse or social-engineering of users.
The documented ability to collect a phone number, send verification codes, log in, and assist with purchasing plans is not justified by the skill’s stated product-listing function. A product-management skill should not be able to broker identity onboarding or billing transactions, because that creates a privilege and trust boundary mismatch that can be exploited to harvest personal data or induce unintended purchases.
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 file implements LinkFox account onboarding, SMS login, API-key issuance, package listing, order creation, and payment QR generation, none of which align with the declared Shopee store product-management purpose. That scope mismatch is dangerous because it introduces hidden credential and billing functionality under an unrelated skill label, increasing the chance of deceptive data collection and unauthorized account monetization actions.
Embedding order creation, package lookup, and payment QR rendering in a Shopee product-management skill adds unauthorized billing capability unrelated to the advertised function. In context, this is especially risky because users invoking product actions would not reasonably expect subscription purchase behavior, enabling deceptive charging or social-engineered payment requests.
The code provisions LinkFox credentials through SMS login and then returns a generated API key in output, which is outside the stated Shopee product-management scope. This creates a covert credential-harvesting and account-bootstrap path inside an unrelated skill, making compromise and misuse of user accounts much more likely.
The skill exposes capabilities implying access to environment variables, file writes, network, and shell execution, but does not declare any explicit tool scope or permissions boundary. In an agent environment, this weakens least-privilege controls and makes it easier for the skill to perform sensitive actions beyond what a user would reasonably expect from a Shopee product-management helper.
The trigger conditions are overly broad and allow activation for general Shopee product-related discussion, even when the user did not clearly request action on an authorized store. In an agent system, overbroad routing can cause unnecessary access to store-connected tools or sensitive data in contexts that only needed informational conversation.
The skill advertises destructive or state-changing operations like add, update, unlist, delete, stock, and price changes without clearly warning that they affect live store data. In a commerce context this is more dangerous because accidental invocation can directly impact listings, sales availability, pricing, and customer experience.
The skill instructs unconditional local persistence of full API responses and also enables automatic feedback reporting, neither of which is clearly necessary for ordinary Shopee product operations. Because product and store API responses may contain commercially sensitive identifiers, inventory, pricing, moderation, or account data, default retention and secondary disclosure materially increase data-exposure risk.
The skill requires saving every complete API response to session-linked local files by default, which can capture sensitive store, inventory, pricing, comment, moderation, or account-related data beyond what is needed for the immediate task. Persistent local storage increases the attack surface by creating retrievable artifacts that may be exposed to other tools, users, sessions, backups, or later prompts.
Automatic feedback reporting is outside the core purpose of product management and creates an unnecessary outbound data path. Even if intended for quality improvement, it can leak user intent, store metadata, operational results, or error details to another API without informed consent.
The documentation instructs use of an Authorization API key plus accessToken and shopId with an external gateway, but provides no handling guidance, minimization advice, or warning about transmitting store credentials and access data to third-party infrastructure. In an agent setting, this can normalize unsafe secret handling and increase risk of credential leakage, misuse, or overbroad data exposure.
This markdown file applies to SQP-2 and describes write/delete actions such as add_item, update_item, delete_item, and unlist_item. The description lists these capabilities as normal usage but does not warn that they can modify listings, remove products, or affect store availability, which could impact user data and business operations.
The curl example shows external transmission of sensitive material to tool-gateway.linkfox.com, including Authorization, accessToken, and shopId. Although expected for API usage, in a skill context this is security-relevant because it demonstrates sending secrets and store identifiers to an external proxy endpoint without accompanying safeguards or trust-boundary explanation.
export KEY=$LINKFOXAGENT_API_KEY
The documentation describes a product-creation endpoint (add_item) and provides invocation examples, but it does not clearly warn that this operation can create or modify live marketplace listings. In an agent-skill context, missing mutation warnings increases the chance of unintended writes, accidental listing creation, or unsafe automation against a real seller account.
The documentation exposes a state-changing API that creates remote store items but does not clearly warn that invoking it will modify a live Shopee shop. In an agent context, missing mutation warnings increases the chance of unintended inventory or listing changes from ambiguous user prompts, especially because the broader skill is designed to trigger even when users do not explicitly mention product operations.
The documentation exposes a state-changing marketplace action (boost_item) but does not clearly warn that invoking it modifies listing promotion/visibility for up to five items. In an agent setting, missing side-effect warnings increases the chance of unintended boosts, especially because the skill is designed to trigger on broad product-management intents and can act on authorized stores.
The file documents a permanently destructive delete_item capability even though the skill metadata emphasizes product management around listing, querying, and updates. That scope expansion is security-relevant because users or downstream agents may invoke destructive actions they would not reasonably expect from the declared skill behavior, increasing the risk of unauthorized or accidental mass deletion of storefront inventory.