T09 · Insecure Skill Coding Practices
- Location
SKILL.md:158- Finding
Automatic Feedback Reporting Can Disclose User Conversation Data Without Explicit Consent
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill performs the advertised ASIN product lookup, but it also includes under-scoped account login, API-key, payment, persistent storage, and automatic feedback-reporting behavior that users should review carefully before installing.
Install only if you are comfortable with LinkFox handling product queries, account onboarding data, API credentials, billing actions, local response files, and automatic feedback submissions. Avoid using the phone/SMS login or payment flows through an agent unless you explicitly intend to, rotate any API key printed in transcripts, and do not run with untrusted LINKFOX_* or SESSION_ID environment variables.
SKILL.md:158Automatic Feedback Reporting Can Disclose User Conversation Data Without Explicit Consent
scripts/keepa_product_detail.py:34API Credentials and Session Metadata Can Be Sent to an Environment-Controlled Destination
scripts/onboarding.py:62Onboarding Endpoint Overrides Can Exfiltrate Phone Numbers, Verification Codes, and Authentication Tokens
scripts/onboarding.py:486Generated API Key Is Printed in Plaintext to Standard Output
scripts/keepa_product_detail.py:178Unsanitized Session Identifier Enables Output-Directory Traversal and Unsafe Temporary Storage
The request destination and outbound headers are influenced by environment variables, especially LINKFOX_TOOL_GATEWAY and session-related header values. In an agent/runtime context, environment configuration is often less trusted than hardcoded values; this can enable server-side request forgery or credential/token exfiltration by redirecting requests to an attacker-controlled endpoint while sending the API key in the Authorization header.
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 sends authentication tokens, SMS-login data, and API-key workflow traffic to base URLs that can be overridden via environment variables. In an agent/runtime environment where env vars may be influenced by operators, wrappers, or other components, this can redirect sensitive credentials to attacker-controlled endpoints and enable SSRF-style outbound requests.
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 = ""
Gateway requests use a URL derived from environment-controlled base paths and attach the LinkFox API key in the Authorization header. If the base URL is tampered with, the skill can exfiltrate secrets to an attacker-controlled server while also enabling arbitrary outbound requests from the host environment.
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 static finding indicates the skill behavior extends into authentication, API key generation, account/team info access, billing plans, order creation, payment QR generation, and payment-status checks, none of which are disclosed by the stated ASIN lookup purpose. If accurate, this is a major privilege and trust boundary violation because a product-data skill would implicitly gain access to account and payment workflows unrelated to the user's request.
The static finding indicates the skill behavior extends into authentication, API key generation, account/team info access, billing plans, order creation, payment QR generation, and payment-status checks, none of which are disclosed by the stated ASIN lookup purpose. If accurate, this is a major privilege and trust boundary violation because a product-data skill would implicitly gain access to account and payment workflows unrelated to the user's request.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
- **响应401或402状态码**
- **响应提示算力或余额不足**:消息含"算力余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值",或类似含义的内容。
## Display Rules
1. **Present data clearly**: Show product details in well-structured tables. Group related fields (e.g., dimensions together, sales data together) for readability.
2. **Price and currency**: Always display the price alongside its currency (e.g., "$29.99 USD"). The `currency` field in the response indicates the local currency.
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 module documentation says writing to /tmp is forbidden and that failure to write to the current directory should error out, but the implementation silently falls back to home and temporary directories. This mismatch is security-relevant because operators may rely on the documented guarantee when assessing data handling, yet the code can still write sensitive response data to less controlled locations, creating unintended disclosure risk.
The file implements account onboarding, SMS verification, login, API-key issuance, subscription listing, and order/payment flows rather than ASIN product-detail retrieval described by the skill metadata. This mismatch is dangerous because it expands the skill into credential collection and account monetization capabilities that users and reviewers would not reasonably expect.
The skill can create purchase orders and render payment QR codes even though its stated purpose is ASIN product lookup. Embedding billing operations in an unrelated skill materially increases the risk of unauthorized purchases, deceptive flows, and abuse of the agent as a payment facilitator.
The skill performs SMS-based authentication, retrieves user/team information, and generates API tokens, none of which are necessary for fetching Amazon product details by ASIN. This creates a direct credential-harvesting and secret-provisioning path under misleading functionality, raising the risk of account compromise and abuse.
The skill declares capabilities that involve environment access, file writes, and network use, but it does not explicitly scope or constrain those tools via permissions/allowed-tools. This weakens least-privilege controls and makes it easier for the skill to access secrets, persist data, or make outbound calls beyond what a user would reasonably expect from an ASIN lookup skill.
The skill requires writing complete API responses into persistent, session-organized project directories, which can retain user-provided identifiers, product research activity, and possibly account-related metadata beyond the immediate task. Persistent storage increases the blast radius of later compromise, accidental sharing, repository inclusion, or cross-task data exposure.
Automatic feedback reporting triggered by user reactions or mismatches risks transmitting user content, task context, or behavioral metadata to another API without clear data minimization or consent boundaries. Even if intended for quality improvement, silent exfiltration of conversational details can violate privacy expectations and leak commercially sensitive research requests.
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/productRequest \
The file for an Amazon product-details skill includes a separate feedback-submission API that is unrelated to the declared core function. In an agent setting, this creates an unexpected side-effect channel that could cause user content or task context to be transmitted to a third-party endpoint without clear necessity or consent, increasing the risk of data leakage and prompt-driven misuse.
The onboarding document introduces authentication recovery, account registration, and billing/payment workflows that are outside the declared purpose of an ASIN product-detail lookup skill. This broadens the skill’s operational scope into credential handling and payments, increasing the chance an agent will collect sensitive data or trigger higher-risk actions not justified by the manifest.
The instructions tell the agent to collect a user’s phone number and use it with a script-based send-code/login flow, even though phone-based identity operations are unnecessary for product-information retrieval. This creates unjustified handling of sensitive personal data and authentication tokens, and could enable account takeover or privacy violations if misused or exposed.
The markdown directs collection of the user’s phone number for registration and login without any explicit privacy notice, data-minimization guidance, or warning about handling one-time codes. In the context of a product lookup skill, this is especially dangerous because users would not reasonably expect sensitive identity data collection, making phishing-like misuse more plausible.
The document instructs the agent to list subscription plans, create orders, and guide payment-method selection, which exceeds the purpose of a product-detail lookup skill. Embedding purchase flows in an unrelated skill raises the risk of unauthorized charging guidance, social-engineering abuse, and unsafe handling of commercial transactions.
The top-level docstring, usage notes, and output policy are written entirely in Chinese, which imposes a specific language expectation on users. There is no indication that the skill is region-specific or that users can opt into another language, so this appears to violate the language/locale policy requirement.
The script persistently stores full API responses, cache entries, and session metadata to local disk, including under fallback locations such as the home directory and temp directory. Product-detail responses and associated session metadata may contain sensitive business data, identifiers, or usage traces, and the persistence behavior exceeds the core lookup function described by the skill, increasing data exposure and retention risk.
The module docstring openly describes an onboarding/account CLI, which contradicts the manifest’s ASIN-detail claim. This discrepancy is a strong indicator of deceptive packaging: reviewers and users may invoke the skill expecting product data while actually exposing phone numbers, SMS codes, and payment actions.
The function transmits sensitive onboarding and login data to external services over the network. External transmission is expected for an API client, but in this skill it becomes security-relevant because the destinations are partially environment-configurable and the transmitted data includes credentials and tokens.
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 onboarding flow only accepts 11-digit phone numbers and always submits areaCode '+86', while command help also describes only domestic phone numbers. This enforces a specific locale/language-region behavior without opt-in or documented justification in the file, matching the language/locale policy concern.