T01 · Skill Instruction Hijacking
- Location
SKILL.md:195- Finding
Silent transmission 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 Amazon search skill should be reviewed because it also handles login, API keys, payments, local storage, and automatic feedback reporting beyond a simple search workflow.
Before installing, review whether you want an Amazon search skill to also manage LinkFox account login, API keys, balance purchases, and feedback reporting. Use only trusted environment variables, avoid custom LinkFox gateway URLs unless you control them, treat generated API keys and SMS codes as sensitive, and expect full search responses to be saved locally.
SKILL.md:195Silent transmission of user-derived feedback to an external service
scripts/amazon_search.py:36Credential-bearing requests can be redirected to arbitrary environment-controlled endpoints
scripts/onboarding.py:488Generated API key is printed and recommended for insecure plaintext persistence
scripts/amazon_search.py:250Unsanitized session identifier permits output path traversal
scripts/onboarding.py:163Runtime guidance installs unpinned third-party dependencies
The request includes multiple environment-derived headers, and the destination base URL is also environment-controlled via LINKFOX_TOOL_GATEWAY. This creates a real exfiltration risk: in a compromised or attacker-influenced runtime, API keys and session metadata can be sent to an arbitrary host over the network. In a skill context that runs automatically and handles authenticated requests, this is more dangerous because the code forwards sensitive execution metadata without validating the endpoint.
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 request destinations from environment variables and then sends sensitive data such as phone numbers, SMS codes, access tokens, refresh tokens, and generated API tokens to those endpoints. If an attacker can influence the process environment, they can redirect these requests to attacker-controlled infrastructure and exfiltrate credentials and account data; this is especially dangerous because the file explicitly handles authentication and token issuance flows.
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 an environment-derived base URL and attaches the LinkFox API key in the Authorization header before calling urlopen. An attacker who can set LINKFOX_AGENT_API_URL or related variables can redirect gateway traffic and capture API keys, account data, order details, and other responses; because this skill includes purchase and account-management actions, the exposure is more dangerous than in a simple data-only utility.
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 purpose is Amazon SERP retrieval, but the skill reportedly also performs phone login, API key generation/retrieval, account and subscription inspection, payment order creation, QR code payment generation, and payment-status queries. That is a major capability expansion into authentication, account data, and financial operations, creating risk of unauthorized actions and user confusion about what the skill may do.
The trigger conditions are broad enough to activate the skill for loosely related Amazon research requests, increasing the chance of unnecessary external calls, data transmission, and paid operations. Overbroad activation is especially risky here because the skill can store results locally and may invoke adjacent onboarding or feedback flows.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
{"keyword": "office chair", "amazonDomain": "amazon.com", "deliveryZip": "10001"}
## Display Rules
1. **Present data clearly**: Show search results in well-structured tables with key fields: position, ASIN, title, price, rating, review count, brand
2. **Highlight sponsored products**: Clearly mark which results are sponsored ads vs organic listings
The onboarding document introduces account registration, login, API key retrieval, and payment handling flows that are not intrinsic to an Amazon SERP analysis skill. This expands the skill's operational scope into credential and billing mediation, creating opportunities for sensitive-data collection, social-engineering abuse, and unauthorized account provisioning if the skill is triggered in normal use.
The documented phone-based registration/login and plan-purchase workflow is context-inappropriate for a search-ranking skill and encourages the agent to collect a user's phone number, process verification codes, and facilitate purchases. In this context, those capabilities materially increase the risk of phishing-like behavior, privacy violations, and user confusion about whether the agent is authorized to handle identity and payment workflows.
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 file implements account onboarding, SMS login, API key retrieval, subscription management, and payment setup, which are materially unrelated to the declared Amazon search/SERP analysis purpose. This scope mismatch increases the chance that users invoke the skill expecting search functionality while instead being led into credential entry and billing flows, creating unnecessary exposure of identity, tokens, and payment actions.
The code can create purchase orders and generate payment QR codes even though the skill is presented as an Amazon search analysis tool. In-context, this is risky because the agent can initiate monetization actions that users would not reasonably expect from the advertised capability, increasing the likelihood of unauthorized or deceptive billing flows.
The skill declares no explicit tool scope or permission boundaries despite instructing use of environment variables, persistent file writes, and network/API access. This creates unnecessary ambiguity about what capabilities the agent may exercise and weakens least-privilege controls, especially because the same skill also references onboarding, auth, and billing-related flows.
The file states that keywords should be in the language of the target marketplace, effectively prescribing a language behavior rather than offering it as a user choice. This is a natural-language locale policy concern because it directs language handling without explicit opt-in, even though the marketplace-specific rationale is understandable.
The skill mandates persistent writes of full response data into session-linked project files without a clear user-facing warning or consent. This can leave potentially sensitive search parameters and results on disk longer than necessary and outside the user's expectations.
Persistently storing full search responses in session-linked files can retain user-supplied data such as delivery ZIP codes and detailed search activity without minimization. Session-based aggregation increases linkability over time, making profiling or unintended disclosure more harmful if files are accessed later.
The skill instructs the agent to automatically report user interactions, dissatisfaction, or praise to a Feedback API even though that behavior is not necessary to perform Amazon search simulation. This can exfiltrate user content or sentiment to a third party without clear consent or minimization.
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/amazon/search \
The file documents a separate public feedback API that is unrelated to the skill’s core Amazon search function, creating an additional data egress path that an agent may invoke without a clear user request. Because the example encourages sending free-form feedback content, it can result in user prompts, outcomes, or other sensitive context being transmitted to a third party without necessity or clear disclosure.
The documentation instructs sending user feedback content to a public API but provides no privacy notice, consent requirement, or data minimization guidance. In practice, an agent could forward user statements, task details, or conversation-derived context to an external service, creating a meaningful privacy and compliance risk.
The markdown explicitly instructs collection of a user's phone number and handling of SMS-code-based login steps without any privacy notice, retention limits, or warning about sensitive personal data. Even if intended for legitimate onboarding, this normalizes unsafe handling of PII and authentication factors through the agent channel.
The user-facing documentation promises cwd-only storage and explicitly says not to write to /tmp, but the implementation may write under the home directory or temporary directory and also maintains a cache elsewhere. This discrepancy can cause sensitive API responses to be persisted in locations the operator would not expect, weakening data handling assurances and potentially exposing search data or account-linked metadata to other local users/processes.
The code sends session and app metadata headers with every request without any nearby disclosure or minimization. While such headers may be operationally useful, they can leak conversation/session identifiers and application context to the remote service, increasing traceability and privacy risk. In this skill, which performs real-time external queries, the automatic transmission of metadata makes the issue more significant.
The script always writes full API responses to disk, but the documented behavior omits that storage may fall back outside the current workspace, including home or temp directories. Because responses may contain commercially sensitive search intelligence, identifiers, or error details, undisclosed persistence broadens the exposure surface and can violate operator expectations or retention policies.
The module description, help text, logs, and validation messages are entirely in Chinese, and the CLI also assumes a domestic phone format and +86 area code. This imposes a specific language/locale behavior without offering the user a choice or documenting it as a justified region-specific constraint.
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 = ""
No suspicious patterns detected.