Back to skill

Security audit

传输单边故障日报报表生成器

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Excel report generator, but users should treat its input and output workbooks as potentially sensitive and harden dependency installation.

Install only if you expect a Chinese-language transmission-fault Excel reporting workflow. Use a virtual environment with pinned dependencies, review or adjust the hardcoded input/output paths, and avoid sharing generated workbooks until you confirm the raw-data sheet does not expose sensitive rows or spreadsheet formulas.

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

Warning
Location
scripts/generate_assessment_period_report.py:466
Finding
Untrusted Spreadsheet Values Are Exported Without Formula Neutralization## Vulnerability Details **File Location**: `scripts/generate_assessment_period_report.py`, lines 466-472 **Vulnerability Type**: Spreadsheet formula injection **Risk Level**: Medium ```python for i, (_, row) in enumerate(all_data.iterrows(), start=2): for j, col in enumerate(all_columns, start=1): value = row[col] # Handle NaN values if pd.isna(value): value = '' ws_raw.cell(row=i, column=j, value=value) ``` ### Technical Analysis The report generator copies values from the input workbook directly into cells in the output workbook. It does not inspect or neutralize strings that begin with spreadsheet formula prefixes such as `=`, `+`, `-`, or `@`. Consequently, an attacker who can influence the source workbook may insert formula-like content into any field exported to the raw-data worksheet. When the generated workbook is opened in formula-capable spreadsheet software, that content may be interpreted as a formula rather than as literal text. The exact behavior depends on the spreadsheet application and its security configuration. Potential payloads include deceptive formulas, external links, or functions that attempt to transmit workbook or environment data to an attacker-controlled destination. ### Attack Path 1. An attacker gains the ability to add or modify a value in the source Excel workbook. 2. The attacker inserts a formula-prefixed value into a field that will be copied to the raw-data worksheet. 3. The report generator reads the malicious value through pandas. 4. The value is passed unchanged to `ws_raw.cell(..., value=value)`. 5. The generated report is delivered to or opened by an authorized user. 6. The spreadsheet application interprets the value as a formula. 7. Depending on application policy and user interaction, the formula may display deceptive content, access other workbook cells, or initiate an external request. ### Impact Assessment ...[truncated 584 chars]
Remediation
## Remediation Suggestions Treat every value originating from an input workbook as untrusted before writing it to the output workbook. 1. Detect strings beginning with formula-significant characters, including `=`, `+`, `-`, `@`, tab, carriage return, and line feed. 2. Store such values explicitly as text or prefix them with an apostrophe before writing them. 3. Apply the protection to every worksheet that contains source-controlled values, not only the raw-data worksheet. 4. Consider using a strict allowlist for fields that are expected to be numeric or datetime values. 5. Add regression tests containing representative payloads such as formula prefixes, leading whitespace followed by a formula, and external-link formulas. 6. Document that reports should be opened with external content and macros disabled. Example hardening logic: ```python def neutralize_spreadsheet_formula(value): if isinstance(value, str): normalized = value.lstrip() if normalized.startswith(('=', '+', '-', '@', '\t', '\r', '\n')): return "'" + value return value value = neutralize_spreadsheet_formula(value) ws_raw.cell(row=i, column=j, value=value) ```

T08 · Insecure Dependencies

Note
Location
SKILL.md:125
Finding
Third-Party Dependencies Are Installed Without Version or Integrity Constraints## Vulnerability Details **File Locations**: - `SKILL.md`, line 125 - `references/README.md`, line 8 **Vulnerability Type**: Unpinned third-party dependencies **Risk Level**: Low The installation instruction in both files is: ```bash pip3 install pandas openpyxl ``` ### Technical Analysis The documentation instructs users to install `pandas` and `openpyxl` without exact version constraints or package hashes. Installation therefore resolves mutable package versions from the user's configured Python package index at installation time. The package names are conventional, and the audited project does not specify a suspicious package source. Nevertheless, the installation is not reproducible and provides no integrity verification. A compromised upstream release, an untrusted configured package mirror, or a future incompatible version could introduce unintended code or behavior. Python packages and their transitive dependencies execute with the privileges of the user performing the installation and subsequently importing them. ### Attack Path 1. A user follows the documented installation command. 2. pip connects to the package index configured in the user's environment. 3. pip resolves the latest versions allowed at that time, including transitive dependencies. 4. If the configured index or a resolved release is compromised, malicious package code is downloaded and installed. 5. Malicious installation or imported runtime code executes with the installing or report-generating user's privileges. ### Impact Assessment Exploitation would provide code execution under the account running pip or the report generator. That code could access files, environment variables, network resources, and other data available to that account. The project does not request elevated installation privileges, so administrative or root access is not inherently obtained. The risk is limited by the privileges of the user or automation account ...[truncated 64 chars]
Remediation
## Remediation Suggestions 1. Create a reviewed dependency lock or requirements file containing exact versions. 2. Record cryptographic hashes and install with pip's `--require-hashes` option. 3. Include and lock relevant transitive dependencies where practical. 4. Document the trusted package index that should be used. 5. Install dependencies in an isolated virtual environment rather than into the system Python environment. 6. Use automated dependency scanning and controlled update reviews. Example installation approach: ```bash python3 -m venv .venv . .venv/bin/activate python3 -m pip install --require-hashes -r requirements.txt ``` The documentation in both `SKILL.md` and `references/README.md` should reference the same reviewed requirements file.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared purpose is simple report generation, but the finding indicates additional behaviors such as filesystem scanning, reading SKILL.md, compiling another Python script, and source-string inspection. Hidden or undocumented behaviors materially increase risk because users may authorize a reporting task while the skill performs unrelated local inspection actions.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger phrase "日报统计" is generic and could match many ordinary requests for daily statistics outside this specific transmission-fault reporting skill. The trigger list does not include exclusions or context constraints to narrow when this skill should activate versus other reporting-related skills.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill advertises executable behavior and file access patterns but does not declare any explicit tool scope or permission boundaries. In an agent environment, missing scope declarations can cause over-broad execution authority, making unintended file reads or shell use harder to review and constrain.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
The skill explicitly preserves all raw input rows in the output workbook, but the description does not prominently warn users about this data retention and propagation behavior. If the source spreadsheet contains sensitive operational or personal data, the generated report can unintentionally duplicate and spread that data to downstream recipients.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The trigger list includes generic phrases such as "生成日报报表", "日报统计", and "考核周期报表" without constraints on data domain, input format, or exclusion conditions. In a markdown skill description, these broad phrases can cause unintended invocation for unrelated daily-report or statistics tasks.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This code file contains user-facing natural-language strings and documentation exclusively in Chinese, including the module docstring and runtime prompts. The policy requires flagging cases where a skill forces a specific language without user opt-in, and no alternative language option or justification is provided here.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
# 运行脚本
        try:
            result = subprocess.run(
                ["python3", script_path],
                cwd="/Users/ahs/.openclaw/workspace/传输单边故障",
                capture_output=True,
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Context-Inappropriate Capability

Medium
Confidence
84% confidence
Finding
The manifest describes a report-generation skill for transmission fault daily reports. In this example file, the code launches an external process via subprocess.run rather than directly generating or formatting a report, adding process-execution capability that is broader than the stated reporting purpose.

Unbounded Output

Medium
Category
Output Handling
Content
# 自动调整列宽
    for col in ws_raw.columns:
        max_length = 0
        column = col[0].column_letter
        for cell in col:
            try:
Confidence
75% confidence
Finding
Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This code file contains natural-language strings and docstrings exclusively in Chinese, including the skill description and test output. The policy scope includes code files, and there is no indication that language selection is optional or justified as region-specific, so it appears to impose a specific locale without user opt-in.

compile() call detected

Medium
Category
Dangerous Code Execution
Content
try:
            with open(script_path, 'r', encoding='utf-8') as f:
                script_content = f.read()
            compile(script_content, script_path, 'exec')
            print("✅ 脚本语法正确")
        except SyntaxError as e:
            print(f"❌ 脚本语法错误: {e}")
Confidence
65% confidence
Finding
compile() creates code objects from strings. When combined with exec()/eval(), it enables obfuscated code execution.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The document consistently uses Chinese for the skill name, description, triggers, and usage guidance, which can amount to a language constraint if the organization expects user language choice. There is no note that the skill is intended specifically for Chinese-speaking users or that language preference is selectable.

Missing User Warnings

Low
Confidence
85% confidence
Finding
The document states that the skill generates an Excel file with a timestamped name, which affects user data/storage by creating a file artifact. However, this markdown does not warn the user that running the skill will write a new Excel file to disk or clarify where it will be saved.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
All user-facing description, usage guidance, triggers, and examples are presented only in Chinese, with no indication that another language can be used or that the Chinese-only scope is intentional and justified. This can constitute a language policy issue when a skill implicitly requires a specific language without user opt-in.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The entire user-facing documentation is written in Chinese, including headings, instructions, and support text, with no indication that other languages are supported or that Chinese is required for a region-specific purpose. Per the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
This file contains user-facing natural-language text and documentation exclusively in Chinese, including the module docstring and later status messages, but provides no user opt-in or explanation that the skill is intended only for a Chinese-speaking or region-specific environment. Under the language/locale policy, forcing a specific language without choice or justification is a natural-language policy concern.

Static analysis

No suspicious patterns detected.