Back to skill

Security audit

鸿蒙开发决策助手

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent HarmonyOS app feasibility reporter, but its generated HTML can include unsanitized user or web-sourced text that may run unwanted browser code when opened.

Review before installing. Use it only with product ideas you are comfortable sending through web search, choose report output paths carefully, and treat generated HTML as untrusted until the report generator escapes all inserted text and adds a restrictive Content Security Policy.

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/report_generator.py:117
Finding

Stored HTML and Script Injection in Generated Reports

Content
View full analysis
鸿蒙原生应用可行性决策报告 - {name} ``` ```python

🦋 {name}

{direction}
``` ```python eco_detail = safe_get( ecosystem, "detail", "鸿蒙已成为中国第二大移动操作系统,市场份额达18%。" "\"纯血\"鸿蒙设备从2025年11月的2300万台增长到2026年初的" "5100万台,4个月内翻倍,增长速度行业最快。" "华为每年投入60亿元激励开发者,生态正处价值洼地。" ) ``` ```python

{eco_detail}

``` ```python comp_detail = safe_get(competitors, "detail", "暂无详细数据") ``` ```python

{comp_detail}

``` The resulting document is subsequently written to disk: ```python output_path = Path(args.output) output_path.parent.mkdir(parents=True, exist_ok=True) output_path.write_text(html, encoding="utf-8") ``` ### Technical Analysis `safe_get()` only retrieves values from dictionaries and does not perform HTML escaping, sanitization, or type validation. Product names, descriptions, web-derived research data, competitor information, and other caller-controlled fields are inserted directly into HTML element and metadata contexts. An attacker can supply markup that closes the current element and introduces an executable element or event handler. For example, a malicious product name could contain: ```html ``` Other fields inserted into body elements could contain event-handler payloads such as: ```html <img src=x onerror="/* attacker-controlled JavaScript */"> ``` Because the payload is persisted in the generated file, it executes when a user opens that ...[truncated 1601 chars]
Remediation
View remediation
``` This policy should be tested against required report functionality. Avoid enabling scripts, remote resources, inline event handlers, or form submission unless they are strictly required. 6. Add regression tests containing payloads in every supported input field. Verify that characters such as `<`, `>`, `&`, `"`, and `'` are encoded and that no executable elements or event-handler attributes appear in the resulting document. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · scripts/report_generator.py (reported line 283)May include surrounding context.

python
�2026年初的5100万台,4个月内翻倍,增长速度行业最快。华为每年投入60亿元激励开发者,生态正处价值洼地。")

    trend_icon = "📈" if "上升" in str(eco_trend) else ("📉" if "下降" in str(eco_trend) else "➡️")
    trend_color = "#10B981" if "上升" in str(eco_trend) else ("#EF4444" if "下降" in str(eco_trend) else "#6B7280")

    html += f"""
  <!-- 1. Ecosystem -->
  <div class="section">
    <h2>🔥 一、鸿蒙生态热度分析</h2>
    {make_score_bar(eco_score)}
    <div class="stat-row">
      <div class="stat-card" style="background:#F0F9FF;">
        <div class="stat-value" style="color:#1D4ED8;">{eco_share}</div>
        <div class="stat-label">中国市场份额</div>
      </div>
      <div class="stat-card" style="background:#ECFDF5;">
        <div class="stat-value" style="color:#065F46;">{eco_devices}</div>
        <div class="stat-label">纯血鸿蒙设备数</div>
      </div>
      <div class="stat-card" style="bac

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrase at line 11 is broad enough to overlap with ordinary product-planning or feasibility questions, which can cause the skill to activate when the user did not explicitly intend to invoke it. Unintended activation can redirect conversations, cause irrelevant report generation, and increase the chance that the skill processes sensitive business ideas without clear user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrase at line 12 lacks enough specificity and may match common language like 'can HarmonyOS do this,' leading to accidental invocation during normal discussion. In a planning/analysis assistant, this creates reliability and privacy concerns because the skill may capture broad business context and generate output without deliberate consent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill instructs the agent to generate an HTML report and explicitly shows writing it to disk (--output output_path.html, open('output.html', 'w', ...)) but does not declare any tool scope such as permissions or allowed-tools. This creates an undeclared file-write capability boundary, which can lead to unexpected local file creation or overwrite if the runtime permits execution of these steps.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The example trigger phrases are broad natural-language expressions such as '帮我评估…可行吗' and '分析…可行性', which can overlap with ordinary conversation. This can cause accidental invocation of the skill, leading to unintended network searches or report generation without the user's clear intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow directs the agent to use WebSearch and optionally WebFetch to collect market, competitor, and user-profile information, but the user-facing description does not clearly disclose that external network requests and page fetching will occur. Lack of disclosure can expose user-provided product ideas or sensitive business plans to third-party services without informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The entire skill description, trigger list, and examples are presented only in Chinese, with no indication that users may choose another language or locale. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

L003 的整体描述、触发词与行为说明均默认面向中文输入,没有说明是否支持其他语言或允许用户选择输出语言。按规则,若技能隐含强制特定语言而没有用户 opt-in,属于自然语言层面的语言/locale 策略问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The generated HTML hard-codes lang="zh-CN", and the surrounding report content and CLI descriptions are written to produce Chinese-language output by default. This creates a locale-specific behavior without offering user opt-in or a configurable language choice, which matches the policy-violation category for forced language/locale behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.