Back to skill

Security audit

选品助手

Security checks for vulnerabilities and agentic risk

Overview

The skill’s purpose is coherent, but its generated HTML reports can execute untrusted product or web-search text as browser code.

Review before installing. The main fix needed is HTML/JavaScript escaping and safer serialization for every report field before opening or sharing generated reports. Treat reports as untrusted HTML, avoid hosting them on authenticated domains, and prefer explicit confirmation before web searches and file creation.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_report.py:371
Finding

Stored HTML and JavaScript Injection in Generated Reports

Content
View full analysis
{dim['name']}
{dim['desc']}
{bar}{dim['score']}
''') return '\n'.join(items) def build_analysis_cards(analyses): type_map = { 'demand': ('demand', '📊'), 'competition': ('competition', '🏪'), 'profit': ('profit', '💰'), 'seasonality': ('seasonality', '📅'), 'risk': ('risk', '⚠️'), 'opportunity': ('opportunity', '💡'), } cards = [] for a in analyses: css_class, icon = type_map.get(a.get('type', ''), ('', '📌')) content = a.get('content', '') if isinstance(content, list): content = '
    ' + ''.join(f'
  • {item}
  • ' for item in content) + '
' else: content = f'

{content}

' cards.append(f'''

{icon} {a['title']}

{content}
''') return '\n'.join(cards) def build_action_items(actions): items = [] for a in actions: priority = a.get('priority', 'P2').lower() items.append(f'''
{a.get('priority', 'P2')}

{a['title']}

{a['desc']}

''') return '\n' ...[truncated 4157 chars]
Remediation
View remediation
` elements Numeric values used in scores or CSS widths must be validated as numbers rather than escaped as arbitrary strings. 3. **Safely serialize chart data.** Avoid embedding attacker-controlled strings directly into an executable inline script. Prefer placing JSON in a non-executable element: ```html ``` Before embedding, serialize it with an HTML-safe JSON encoder that escapes `<`, `>`, `&`, U+2028, and U+2029. Parse the value using `JSON.parse()` from trusted static JavaScript. 4. **Strengthen schema validation.** Validate that: - Text fields are strings and have reasonable maximum lengths. - `dimensions`, `analyses`, and `actions` are lists with bounded sizes. - Every dimension score is numeric and between 0 and 100. - Analysis types and priorities are selected from explicit allowlists. - Unexpected nested objects or HTML-capable values are rejected. 5. **Add a restrictive Content Security Policy.** Refactor the inline script into a separate trusted JavaScript file, then use a policy similar to: ```http Content-Security-Policy: default-src 'none'; script-src 'self' https://cdn.jsdelivr.net; style-src 'self'; img-src 'self' data:; connect-src 'none'; base-uri 'none'; object-src 'none' ``` ...[truncated 551 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个端到端的选品分析助手,核心能力包括接收商品信息、联网检索市场数据、分析六个维度并给出上架建议。实际代码块的主功能只是报告渲染:它依赖外部已经准备好的JSON分析结果,生成带图表的HTML页面。虽然它确实生成了交互式HTML可视化分析报告,并根据总分生成“强烈推荐/建议上架/谨慎上架/不建议上架”的文案,但这只是声明中的最后一步展示层,并未体现声明中更关键的“自动联网搜索”和“自动分析”能力。因此描述与该代码块实际行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states that the skill will automatically perform web searches and generate an interactive HTML report, but it does not clearly warn users that external data access and local file output will occur. This can create privacy, transparency, and trust issues, especially if product descriptions, ASINs, or business-sensitive inputs are sent to third parties or written to disk without explicit user awareness.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger examples are generic conversational phrases like '这个产品好不好卖?' and '帮我看看 XXX 值不值得上架', which can cause accidental or overly broad activation of the skill. In an agent environment, this increases the chance of unintentional web access and downstream report-generation behavior when the user may only be asking a casual question.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill instructs the agent to generate an HTML report under the user's working directory, which is a file-write capability, yet it declares no explicit tool scope or permissions. This creates a least-privilege and transparency problem: the agent may write files without the user having been clearly warned through permission metadata, increasing the risk of unintended filesystem side effects.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad and include common language that could cause the skill to activate on ordinary conversation about whether a product is worth selling. Unintended invocation matters here because the skill can initiate web searches and generate local HTML files, causing network activity and filesystem writes without sufficiently deliberate user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The catch-all trigger condition ('any request involving evaluation of a single product's market feasibility') is overly ambiguous and lacks boundaries. In context, this broad activation is more dangerous because the workflow includes external search and report generation steps, so an accidental match can lead to unintended data access, outbound queries, and file creation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill behavior includes writing an HTML report into the user's current working directory, but the description does not warn users up front that local files will be created. This lack of transparency can lead to surprise side effects, accidental overwrites or clutter, and reduced user ability to make an informed decision before granting or triggering the workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file’s natural-language content and generated HTML are explicitly fixed to Chinese, including lang="zh-CN", Chinese titles, labels, and recommendation text. Under the policy rule, forcing a specific language without user opt-in is a natural-language locale violation because users are not given any language or locale choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

All user-facing documentation and examples are presented only in Chinese, and there is no indication that the skill can respond in another language or honor user preference. This can be a language/locale policy issue when a skill implicitly fixes one language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The instruction "搜索时优先使用中文 + 英文双语关键词" imposes a specific language behavior by default, but the skill does not offer the user a language preference or explain why this locale policy is required. Under the policy, forced language behavior without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.