Back to skill

Security audit

competitor-patent-landscape

Security checks for vulnerabilities and agentic risk

Overview

The skill’s patent-reporting purpose is coherent, but its report generator renders untrusted analysis data into HTML/PDF without escaping or resource restrictions, creating a real review-worthy risk.

Review before installing or using with untrusted patent/search data. Run report generation in an isolated environment, avoid opening generated HTML from untrusted inputs, and prefer a version that escapes all report fields, validates analysis.json, and disables or tightly restricts WeasyPrint resource fetching.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_report.py:81
Finding

Unescaped Report Data Enables HTML Injection and Server-Side Resource Requests

Content
View full analysis
{i+1}{t.get('name','')}{t.get('description','')}" for i, t in enumerate(tech_framework) ) top_patents = data.get("top_patents", []) patent_rows = "" for p in top_patents: layout_type = p.get("layout_type", "外围") badge_cls = "badge-core" if layout_type == "核心" else "badge-periph" patent_rows += ( f"" f"{p.get('title', '')}" f"{p.get('publication_number', '')}" f"{p.get('family_size', '-')}" f"{p.get('tech_sub_area', '-')}" f"{layout_type}" f"{p.get('claim_summary', '')[:120]}…" f"" ) suggestions = data.get("suggestions", []) sug_items = "".join(f"
  • {s}
  • " for s in suggestions) sources = data.get("sources", []) src_items = "".join(f"
  • {s}
  • " for s in sources) ``` The generated fragments and other JSON fields are then inserted directly into the report: ```python html = f""" {competitor} · {technology} 专利布局策略分析 {STYLE}

    竞争对手专利布局策略分析报告

    竞争对手:{competitor}  |  技术领域:{technology}  |  市场范围:{market_scope}  |  检索专利总数:{total_patents} 件  |  生成时间:{generated_at}

    {low_data_warn}

    ① 执行摘要

    {exec_summary}

    ② 技术框架

    #技术子方向< ...[truncated 3818 chars]
    Remediation
    View remediation
    link ``` Test ...[truncated 85 chars]

    T08 · Insecure Dependencies

    Warning
    Location
    scripts/generate_report.py:243
    Finding

    Unpinned Third-Party Dependency Installation Guidance Creates Supply-Chain Risk

    Content
    View full analysis
    Remediation
    View remediation
    ``` 2. Use a lock file that pins all transitive dependencies, not only the top-level package. 3. Require package hashes during installation: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Generate and review hashes from trusted artifacts, and update them only through a controlled dependency-upgrade process. 5. Install packages from an explicitly configured trusted package index. Avoid unreviewed extra indexes, which increase dependency-confusion risk. 6. Replace the emitted command with guidance referencing the project's locked dependency file: ```python print("[HINT] Install reviewed dependencies with: " "python -m pip install --require-hashes -r requirements.txt") ``` 7. Run dependency vulnerability and integrity scanning in continuous integration. 8. Install and execute the report generator in an isolated, least-privileged virtual environment or container. Do not recommend administrator-level installation. ]]>
    Vulnerability Patterns
    • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
    • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
    • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
    • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
    • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
    Findings (6)

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    99% confidence
    Finding

    The declared description promises a full patent intelligence and reporting workflow, but the supplied code chunk contains only a trivial main script that prints a readiness message. There is no evidence of business logic, data access, input handling, analytics, visualization, or report export. This is a material description-behavior mismatch because the actual code does not perform the claimed primary purpose at all.

    Content

    No source excerpt is available for this finding.

    Undeclared Tool Scope

    Medium
    Category
    MCP Least Privilege
    Confidence
    85% confidence
    Finding

    The skill advertises writing an HTML report to a session output path but does not declare any explicit tool scope such as allowed-tools or permissions. In agent environments, undeclared file-write capability weakens least-privilege controls and can enable unintended or overly broad filesystem writes if the runtime grants defaults more permissive than the author expected.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    The natural-language content of the skill, including the description and operating instructions, is entirely in Chinese. Under the stated policy, forcing a specific language without user opt-in is a policy violation unless the locale constraint is explicitly documented and justified, which is not present here.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    This code file contains natural-language descriptions and generated report content entirely in Chinese, including the CLI description and HTML lang="zh-CN", which forces a specific language/locale. Under the policy, this is a violation unless the skill offers language choice or clearly documents a justified region-specific constraint, which it does not.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    97% confidence
    Finding

    The HTML template sets lang="zh-CN", which enforces a Chinese locale for all generated reports. The file does not provide any configuration or opt-in mechanism for alternative languages/locales, and no justification for this restriction is documented.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    92% confidence
    Finding

    该工作流指南从标题到步骤、输出说明与注意事项均以中文撰写,没有说明这是面向特定中文用户群体的区域性技能,也没有提供语言选择或用户选择加入的机制。根据自然语言政策要求,强制单一语言而无用户选择可构成语言/locale 策略违规。

    Content

    No source excerpt is available for this finding.