Back to skill

Security audit

工作周报技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent with its report-generation purpose, but its HTML output can preserve and run injected markup from report inputs.

Review before installing. Use it only with trusted report inputs or after fixing HTML escaping, because a malicious Word, Excel, JSON, or transcribed value could become active markup inside the saved report. Expect it to read user-specified local files and save persistent report copies under weekly_reports/history.

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_html.py:145
Finding

Stored HTML and JavaScript Injection in Generated Reports

Content
View full analysis
= 100 else "status-warning" if float(rate.rstrip("%")) >= 90 else "status-error" status_text = "达标" if float(rate.rstrip("%")) >= 100 else "接近" if float(rate.rstrip("%")) >= 90 else "未达" metrics_rows += f'{name}{actual}{target}{rate}{status_text}\n' # Generate production-line rows production = data.get("production", []) production_rows = "" for p in production: production_rows += f'{p.get("line", "")}{p.get("output", "")}{p.get("quality", "")}{p.get("oee", "")}{p.get("note", "-")}\n' production_analysis = f'

数据分析:{data.get("production_analysis", "暂无")}

' if data.get("production_analysis") else "" # Generate completed items completed_items = "" for item in data.get("completed", []): completed_items += f'
  • {item.get("title", "")}
    {item.get("result", "")}
  • \n' # Generate in-progress items in_progress = "" if data.get("in_progress"): in_progress = '

    进行中项目

      ' for item in data.get("in_progress"): in_progress += f'
    • {item.get("title", "")}
      {item.get("progress", "")}
    • \n' in ...[truncated 3970 chars]
    Remediation
    View remediation
    ``` 5. Add regression tests covering malicious values in every rendered field. Payloads such as the following must appear only as escaped text: ```html ``` 6. Regenerate or sanitize previously created reports before redistributing them, because existing files may already contain persistent injected markup. ]]>
    Vulnerability Patterns
    • 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
    • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
    • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
    Findings (18)

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    94% confidence
    Finding

    This mismatch is security-relevant because the skill presents itself as a report-generation tool but apparently performs local file copying/archival behavior not clearly reflected in the declared purpose. Hidden or under-disclosed file-management behavior can mislead users into granting trust or invoking the skill in contexts where persistent storage and local file handling are not expected.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    95% confidence
    Finding

    This mismatch is security-relevant because the skill presents itself as a report-generation tool but apparently performs local file copying/archival behavior not clearly reflected in the declared purpose. Hidden or under-disclosed file-management behavior can mislead users into granting trust or invoking the skill in contexts where persistent storage and local file handling are not expected.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    95% confidence
    Finding

    This mismatch is security-relevant because the skill presents itself as a report-generation tool but apparently performs local file copying/archival behavior not clearly reflected in the declared purpose. Hidden or under-disclosed file-management behavior can mislead users into granting trust or invoking the skill in contexts where persistent storage and local file handling are not expected.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    97% confidence
    Finding

    This mismatch is security-relevant because the skill presents itself as a report-generation tool but apparently performs local file copying/archival behavior not clearly reflected in the declared purpose. Hidden or under-disclosed file-management behavior can mislead users into granting trust or invoking the skill in contexts where persistent storage and local file handling are not expected.

    Content

    No source excerpt is available for this finding.

    Undeclared Tool Scope

    Medium
    Category
    MCP Least Privilege
    Confidence
    83% confidence
    Finding

    The skill clearly describes reading local files, creating output files, and archiving reports, yet it declares no explicit tool scope such as allowed-tools or permissions. This creates an authorization ambiguity where an agent may be induced to perform file reads/writes beyond what users expect, increasing the risk of unintended local data access or persistence.

    Content

    No source excerpt is available for this finding.

    Vague Triggers

    Medium
    Category
    Not specified by scanner
    Confidence
    93% confidence
    Finding

    The trigger conditions are broad enough to activate on generic requests like submitting production data or asking for a report, without precise boundaries on when file parsing or archival should occur. Overbroad triggering can cause the skill to engage in contexts the user did not intend, increasing the chance of unnecessary file access, persistence, or misuse in adjacent workflows.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    91% confidence
    Finding

    The skill states that scripts will automatically create directories and later write report files, but it does not prominently warn users that invoking the skill causes filesystem changes. Silent file creation and persistence are dangerous because they may store sensitive business data locally without informed user consent or retention awareness.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    94% confidence
    Finding

    Automatic archival of generated reports means potentially sensitive operational data is stored persistently in a history directory, yet the skill does not clearly present this as a privacy and retention decision. In a production-management context, archived reports may contain internal metrics, incident details, and planning information that should not be retained by default.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    91% confidence
    Finding

    The title and overview define the report format entirely in Chinese and present it as the required standard for agent-generated output. There is no indication that users may choose another language or that the Chinese-only constraint is a documented, justified regional requirement, which can violate language/locale policy.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    The script description and generated report content are fixed in Chinese, and the HTML template explicitly sets lang="zh-CN". This imposes a specific language/locale behavior without any user choice, which matches the policy category for language or locale violations.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    This Python file contains natural-language strings that define the tool's description and interface in Chinese, starting with the module docstring. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

    Content

    No source excerpt is available for this finding.

    Description-Behavior Mismatch

    Medium
    Category
    Not specified by scanner
    Confidence
    87% confidence
    Finding

    Manifest将技能描述为把输入解析为结构化HTML周报,并支持4周历史追踪、数据不足时拒绝;读取历史与校验完整性和该目的相符,但archive_report会把任意指定文件复制写入历史目录,属于额外的持久化归档行为。该写入能力并未在描述中体现为技能对外能力,因此代码实际操作范围超过了文字声明。

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    93% confidence
    Finding

    The argparse description and help strings shown to users are all in Chinese, which forces a single language for the CLI experience. The file does not provide any language selection mechanism or documented regional justification for this constraint.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    93% confidence
    Finding

    This code file contains multiple natural-language strings such as the module docstring, error messages, and CLI argument descriptions entirely in Chinese. Under the policy, forcing a specific language without user opt-in is a language/locale policy violation unless the locale restriction is explicitly justified, which is not present here.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    77% confidence
    Finding

    The TRACE section states the skill supports Chinese interaction, while the rest of the document is written entirely in Chinese and does not indicate whether other languages are supported or whether the user can choose their preferred language. This can be interpreted as a language policy constraint without explicit opt-in.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Low
    Category
    Not specified by scanner
    Confidence
    84% confidence
    Finding

    This code performs a filesystem write by creating parent directories and writing the generated HTML to the specified output path. Although this is the script's main function, there is no explicit user-facing disclosure such as a confirmation prompt, warning, or log message before the write beyond the final generic result JSON.

    Content

    No source excerpt is available for this finding.

    Intent-Code Divergence

    Low
    Category
    Not specified by scanner
    Confidence
    81% confidence
    Finding

    模块注释将行为表述为针对“新周报”的自动归档,暗示对象范围较窄;但archive_report通过--file接收任意路径,仅依据文件名推断周次后复制到历史目录,并未验证该文件是否为新生成周报或是否属于周报。这里的文档意图比实际行为更受限,形成轻度意图-代码偏差。

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    The module docstring and user-facing error/help text are written in Chinese, and the script does not indicate that it is intentionally limited to a Chinese-speaking context or provide any language opt-in. This is a natural-language locale constraint visible to users and may violate language-choice policy when not explicitly justified.

    Content

    No source excerpt is available for this finding.

    Static analysis

    No suspicious patterns detected.