T01 · Skill Instruction Hijacking
- Location
SKILL.md:174- Finding
Automatic Disclosure of User Feedback and Intent to an External Service
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly supports Amazon history lookups, but it also includes under-scoped account, billing, credential, local persistence, and automatic feedback-reporting behavior that users should review carefully.
Install only if you are comfortable with LinkFox account onboarding, paid quota flows, local saving of full API responses, and external feedback reporting. Avoid setting custom LINKFOX_* endpoint variables, treat printed API keys and SMS codes as secrets, and review payment actions before approving them.
SKILL.md:174Automatic Disclosure of User Feedback and Intent to an External Service
scripts/onboarding.py:72Environment-Controlled Endpoints Can Receive Authentication Credentials
scripts/onboarding.py:487Generated API Key Is Disclosed Through Standard Output
scripts/onboarding.py:147Unsanitized Session Identifier Permits Output-Path Traversal
scripts/onboarding.py:163Installation Guidance Uses Unpinned Runtime Dependencies
The request sent via urlopen includes multiple headers sourced directly from environment variables, and the destination host is also overridable via LINKFOX_TOOL_GATEWAY. This creates a real exfiltration path: in a hostile or multi-tenant runtime, secrets and contextual identifiers such as the API key, SESSION_ID, MESSAGE_ID, MODE_ID, and APP_NAME can be transmitted to an attacker-controlled endpoint without validation.
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 the function sends sensitive authentication material such as access tokens, refresh tokens, phone numbers, SMS codes, and generated API keys to those endpoints. In a skill execution environment, an attacker who can influence environment variables can redirect these requests to attacker-owned 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 configuration and then used by urllib with the Authorization header populated from the agent API key. If that base URL is redirected, the skill will transmit the API key and potentially billing/order data to an attacker-controlled server, enabling unauthorized API use and account abuse.
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 is a significant description-behavior mismatch: the skill claims to retrieve Amazon historical product data, but the detected behavior includes account login, API key generation, user/team info access, plan browsing, order creation, payment-status polling, and QR-code/payment artifact generation. Hidden authentication and payment flows can expose personal data, trigger unintended purchases, or coerce users into off-purpose account actions without informed consent.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
asin: B0XXXXXXXX, domain: 1, days: 90, showPrice: 1, showPriceList: 1, showPriceDeal: 1, showPricePrime: 1, showPriceFba: 1, showPriceFbm: 1, showPriceCoupon: 1, showBsrMain: 1, showSellerCount: 1
## Display Rules
1. **Present data clearly**: Show time-series data in tables or describe trends; avoid subjective business advice unless the user explicitly asks for it.
2. **BSR clarification**: When showing BSR data, remind users that lower values mean better (higher) sales ranks.
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
The documentation claims writing to /tmp is forbidden and that the script should fail if the current directory is not writable, but the implementation silently falls back to home and temp directories. This mismatch is dangerous because operators may rely on the documented storage restrictions and unknowingly allow sensitive responses to be written to broader or less-monitored locations.
This file implements account onboarding, SMS authentication, API key issuance, subscription/package management, and payment handling, which is materially different from the declared skill purpose of retrieving Amazon product historical analytics. Such capability drift is dangerous because users and reviewers may grant trust based on the manifest while the code performs identity and billing operations with access to credentials and payment artifacts.
The code can create orders, fetch payable URLs, and render payment QR codes even though the skill is advertised as a product-history data tool. Embedding billing flows in a mismatched skill increases the risk of deceptive purchases, unauthorized charges, or social engineering because the capability is not justified by user expectations or the manifest.
The script performs SMS-based login, token exchange, team selection, and API key retrieval/generation, none of which are necessary for answering Amazon product-history questions. In the stated skill context, this makes the code more dangerous because it solicits and processes credentials under a benign analytics pretense, increasing the likelihood of over-collection and secret exposure.
The skill describes capabilities that use environment variables, write files, and access networked APIs, yet it declares no explicit tool scope or permission boundary. That creates unnecessary privilege ambiguity: a caller or runtime may grant broader access than users expect, increasing the blast radius if the skill is abused or mis-triggered.
The activation criteria are broad enough to match generic product-research or pricing questions, which can cause the skill to trigger in contexts where the user did not intend a Keepa/LinkFox query. In this skill, that is more dangerous because each invocation may consume paid quota and may lead users into hidden onboarding or billing-related behavior described elsewhere in the file.
The instruction requires the agent to explain additional compute cost to the user using Chinese text in a mixed-language skill, but the file does not offer the user a language preference or document a justified locale restriction. This can violate language/locale policy because the skill imposes a specific language behavior rather than adapting to the user's chosen language.
The line requires a user warning before proceeding with potentially high compute-cost operations, but the instruction is written as an unconditional Chinese-language requirement rather than a user-language-aware disclosure. Because no opt-in or locale justification is provided, this is a natural-language policy issue under the language/locale rule.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
## curl 示例
```bash
curl -X POST https://tool-gateway.linkfox.com/keepa/productSeries \
The documentation adds a separate feedback submission API that is unrelated to the core product-history retrieval function. This creates scope creep and increases the chance that an agent will transmit user-derived content to an external endpoint without a clear user request, especially because the example encourages sending free-form content about user satisfaction or problems.
The feedback API section instructs posting a content field that may include what the user said or intended, but it provides no warning that this information will be sent to an external service. Without a disclosure and consent requirement, an agent could exfiltrate user prompts, preferences, or complaint details to a third party in a way the user does not expect.
The onboarding flow explicitly instructs collecting a user's phone number and verification code to register/login through a script, but it does not provide any privacy notice, consent language, data handling limits, or guidance on protecting the submitted personal data. In a skill context, this creates a real privacy and sensitive-data handling risk because users may be induced to share personal identifiers and OTP material through the agent workflow without understanding how that data will be transmitted, stored, or used.
The script always writes the full API response to disk without an explicit user-facing confirmation at runtime, despite handling potentially sensitive commercial and session-linked data. In the context of a query skill, silent persistence broadens exposure to local users, other processes, backups, and forensic recovery, especially because the user may reasonably expect a transient lookup rather than retention.
The inline comment for SMALL_THRESHOLD says small responses are '直接全量输出,不落文件'. In main(), the script serializes the result, resolves an output path, and writes the full response unconditionally before deciding whether to print inline or summarize.
The script persistently stores full API responses, cache entries, and session metadata even though the skill is described as a query tool. This increases data-retention risk by leaving potentially sensitive product intelligence, usage metadata, and session linkage on disk beyond the immediate request lifecycle.
_resolve_output_path() documents a fixed <cwd>/linkfox/... destination. In reality it delegates to resolve_data_path() via _ensure_session() and _linkfox_root(), which may choose multiple alternate roots and therefore does not guarantee a current-working-directory path.
The file's CLI description and user-facing messages are entirely in Chinese, and the workflow is constrained to '+86' domestic phone numbers and China-specific payment methods. The policy allows locale constraints only when clearly documented and justified or when users are given a choice; this file does not offer language or locale choice, and the region restriction is not explicitly justified as a region-specific tool.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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 code generates or retrieves an API token and returns it in command output without any embedded warning, masking, or constrained handling guidance. Returning sensitive tokens directly increases the chance of accidental disclosure through logs, transcripts, terminal history, downstream tooling, or prompt-injection-assisted exfiltration.
No suspicious patterns detected.