T09 · Insecure Skill Coding Practices
- Location
scripts/ai_tagging.py:168- Finding
Arbitrary LLM endpoint receives the API credential and review content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a legitimate Amazon review-analysis purpose, but it can expose API keys and review data to arbitrary LLM endpoints and auto-opens generated HTML built from untrusted content.
Install only if you are comfortable sending review data and an LLM API key to the configured provider. Use only trusted HTTPS API endpoints, avoid custom or misspelled API bases, prefer throwaway/provider-specific keys, and treat generated reports as untrusted HTML until escaping and report-opening behavior are fixed.
scripts/ai_tagging.py:168Arbitrary LLM endpoint receives the API credential and review content
scripts/generate_report.py:129Unescaped remote and AI-generated data allows stored script injection in automatically opened reports
ASIN: {product_info.get('asin', 'N/A')}
价格: {product_info.get('price', 'N/A')}
评分: {'⭐' * review.get('rating', 0)}
标题: {review.get('title', '')}
内容: {review.get('body', '')[:200]}...
AI摘要: {tags.get('summary', '')}
痛点: {', '.join(tags.get('pain_points', [])) if tags.get('pain_points') else '无'}
卖点: {', '.join(tags.get('selling_points', [])) if tags.get('selling_points') else '无'}
scripts/generate_report.py:135Generated reports execute third-party CDN JavaScript without integrity verification
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
A second behavior-mismatch finding indicates promised capabilities such as AI tagging, report generation, provider compatibility, and market selection may not actually exist or may behave differently than described. Security-relevant mismatches undermine user trust and can conceal unsafe data handling, silent failures, or unexpected outputs.
A second behavior-mismatch finding indicates promised capabilities such as AI tagging, report generation, provider compatibility, and market selection may not actually exist or may behave differently than described. Security-relevant mismatches undermine user trust and can conceal unsafe data handling, silent failures, or unexpected outputs.
The skill allows dynamic external model/provider selection via API base and model parameters. This increases risk because users or downstream tooling can redirect sensitive prompts, review data, and API keys to unintended or malicious providers if there is no endpoint validation.
OpenAI
--api-key sk-xxx --api-base https://api.openai.com/v1 --model gpt-4o-mini
DeepSeek(国内推荐)
Provider configurability is useful, but it expands the attack surface by enabling data export to whatever endpoint the operator specifies. In a skill that handles external content and generates reports, that flexibility should be treated as a security control point, not just a feature.
DeepSeek(国内推荐)
--api-key sk-xxx --api-base https://api.deepseek.com/v1 --model deepseek-chat
其他兼容API:只需修改 --api-base 和 --model
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
请直接输出JSON:"""
return prompt
def _call_llm_api(prompt: str, api_key: str, api_base: str, model: str, debug: bool) -> str:
The primary skill description is written in Chinese and the document does not indicate that other languages are supported or that the user may choose their preferred language. This can violate a language/locale policy when a skill implicitly requires a specific language without opt-in.
The README instructs users to provide LLM and RapidAPI keys and describes sending Amazon reviews to external APIs, but it does not clearly warn that review text and product-related data will be transmitted to third-party services for processing. This creates an informed-consent and data-governance risk: users may unknowingly send potentially sensitive content, violating internal policy, privacy expectations, or contractual restrictions.
The skill declares no explicit tool restrictions even though its documented behavior includes network access and writing HTML/CSV files. Without a least-privilege scope, an agent may grant broader-than-necessary capabilities, increasing the blast radius if the skill is modified, compromised, or triggered unexpectedly.
The manifest description is written only in Chinese, and the document consistently presents the skill in Chinese without offering a language choice. This can constitute a language/locale policy issue when no opt-in or region-specific justification is provided.
Shadow Command Trigger: 'review analyzer' conflicts with built-in command 'review'
The trigger "产品洞察" is generic and could match many ordinary requests about product insights, not just Amazon review analysis. The manifest does not provide exclusion conditions or tighter scope to indicate when this skill should or should not activate.
The trigger "review analyzer" is a broad English phrase that can apply to many contexts beyond Amazon reviews. Without narrowing context, it risks unintended activation from everyday analysis requests involving reviews in general.
The skill processes review text and product data via external providers, but the documentation does not clearly warn users that this content will be transmitted to third-party APIs. This creates a consent and data-handling risk, especially when reviews may contain personal information or when users assume processing is local.
The skill is configured to send data to an external API endpoint (DeepSeek). External transmission is expected for this use case, but it remains security-relevant because review content, prompts, and possibly metadata leave the local environment and may be retained or logged by the provider.
python ~/.workbuddy/skills/amazon-review-analyzer/scripts/analyze.py
--asin B08N5WRWNW
--api-key YOUR_DEEPSEEK_KEY
--api-base https://api.deepseek.com/v1
--model deepseek-chat
The documented default API base points to OpenAI, meaning user-supplied content will be transmitted externally unless overridden. That is not inherently malicious, but it is a real data exposure surface that requires notice and consent.
| `--market` | ❌ | US | 市场区域:US/UK/DE/JP/FR/CA/IT/ES |
| `--max-reviews` | ❌ | 500 | 最大评论数量(建议500-1000) |
| `--api-key` | ✅ | - | LLM API Key(OpenAI/DeepSeek/其他兼容API) |
| `--api-base` | ❌ | https://api.openai.com/v1 | API Base URL |
| `--model` | ❌ | gpt-4o-mini | 模型名称 |
| `--output` | ❌ | ./review_analysis_{ASIN}.html | 输出报告路径 |
| `--rapidapi-key` | ❌ | 内置免费Key | RapidAPI Key(可选,内置有免费额度) |
The example command shows review-analysis data being sent to OpenAI. Because the skill handles potentially sensitive commercial input and possibly personal review text, this is a genuine external data-transfer risk even though it is core to the feature.
OpenAI
--api-key sk-xxx --api-base https://api.openai.com/v1 --model gpt-4o-mini
DeepSeek(国内推荐)
The example command sends data to DeepSeek, creating the same third-party data transfer concerns as other provider examples. Different providers may also imply different jurisdictions and retention practices, increasing compliance and privacy considerations.
DeepSeek(国内推荐)
--api-key sk-xxx --api-base https://api.deepseek.com/v1 --model deepseek-chat
其他兼容API:只需修改 --api-base 和 --model
The example references an external endpoint 'api.openseek.com', which appears inconsistent with the other documented providers and may reflect a typo or undocumented third-party destination. Ambiguous or incorrect endpoints are dangerous because users may unknowingly send API keys and data to the wrong service.
--market US
--max-reviews 500
--api-key sk-xxx
--api-base https://api.openseek.com/v1
**分析报告示例截图**(略)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def tag_review_with_ai(
review: Dict,
api_key: str,
api_base: str = "https://api.openai.com/v1",
model: str = "gpt-4o-mini",
debug: bool = False
) -> Dict:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def tag_review_with_ai(
review: Dict,
api_key: str,
api_base: str = "https://api.openai.com/v1",
model: str = "gpt-4o-mini",
debug: bool = False
) -> Dict:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def tag_review_with_ai(
review: Dict,
api_key: str,
api_base: str = "https://api.openai.com/v1",
model: str = "gpt-4o-mini",
debug: bool = False
) -> Dict:
User-controlled review text is embedded directly into the LLM prompt with no delimiting, sanitization, or stronger instruction hierarchy, so a malicious review can inject instructions like 'ignore prior directions' or manipulate the model's JSON output. In this skill, that can corrupt tagging results, trigger downstream parsing failures, or produce misleading reports at scale.
The instruction '如果评论是英文,请翻译成中文后再分析' imposes a specific language behavior regardless of user preference. This is a natural-language locale policy issue because the skill does not provide a language/locale choice or justify the forced Chinese output as a documented region-specific constraint.
This request transmits prompt contents, which include review text, to an external service. In the context of a review-analysis skill this is expected functionality, but it is still a real data-exposure boundary that can leak personal or proprietary content if users are unaware or if the endpoint is misconfigured.
if debug:
print(f" API URL: {url}")
response = requests.post(url, headers=headers, json=data, timeout=30)
if response.status_code == 200:
result = response.json()