Back to skill

Security audit

银行流水自动对账

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do bank reconciliation as advertised, but it handles sensitive financial records and generates an unsafe HTML report that can run injected script from crafted input files.

Install only after reviewing or fixing the report generation path. Treat all inputs and generated reports as sensitive financial records, use a protected working directory, prefer json-only mode when possible, avoid opening reports from untrusted source files, and pin dependencies in an isolated environment.

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/reconcile.py:762
Finding

Stored Cross-Site Scripting in Generated HTML Reports

Content
View full analysis
= 90 else "#eab308" if match_score >= 70 else "#f97316" match_info = f'{match_type_cn} ({match_score}分)' if show_book_ref and r.get('match_id'): match_info += f' → {r["match_id"]}' rows += f""" {i+1} {date_str} {amount_str} {desc} {cp} {match_info} """ ``` ```python matched_rows_html += f""" {i+1} {m["bank_date"]} {m["bank_amount"]:,.2f} {m["bank_desc"]} {m["book_date"]} {m["book_amount"]:,.2f} {m["book_desc"]} {m["type_cn"]} {m["score"]} """ ``` ```python const data = {json.dumps({"unmatched_bank": serialized["unmatched_bank"], "unmatched_book": serialized["unmatched_book"]}, ensure_ascii=False)}; ``` ### Technical Analysis The report generator directly interpolates transaction fields originating from imported Excel or CSV files into HTML text nodes, HTML attributes, and an inline JavaScript block. Truncating a value does not make it safe. For example, a description ...[truncated 2303 chars]
Remediation
View remediation
{i + 1} {safe_date} {amount_str} {safe_desc} {safe_cp} {match_info} """ ``` 2. Do not place attacker-controlled JSON directly inside an executable inline script. Prefer a non-executable JSON element: ```html ``` Before embedding JSON, replace HTML-significant characters, particularly `<`, with Unicode escapes such as `\u003c`. Parse the content using `JSON.parse(document.getElementById('unmatched-data').textContent)`. 3. Alternatively, write the export data to a separate local JSON file and load or download it without embedding it in executable JavaScript. 4. Add a restrictive Content Security Policy, preferably disallowing inline scripts and event handlers. Move the report JavaScript into a fixed script file with a hash or nonce if necessary. 5. Add regression tests covering malicious values in every imported field, including: - Quotes and angle brackets. - Attribute-breaking payloads. - `` sequences. - Event-handler payloads such as `onerror`. - Unicode and malformed input. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:57
Finding

Unpinned Dependencies Installed from Mutable Package Indexes

Content
View full analysis
Remediation
View remediation
openpyxl== rapidfuzz== ``` 2. Include cryptographic hashes for every direct and transitive artifact, then require verification: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Generate and maintain the lock file with a dependency management tool that resolves transitive dependencies reproducibly. 4. Prefer the official Python Package Index or an organization-controlled repository that verifies and caches approved artifacts. If a mirror is required, document its trust model and validation process. 5. Run installation in an isolated virtual environment using an unprivileged account. Do not recommend global installation or elevated `pip` execution. 6. Add automated dependency scanning and scheduled review of pinned versions. Update pins deliberately after testing rather than resolving the newest available versions during each installation. ]]>
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 (14)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
执行 `scripts/reconcile.py`:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 40)May include surrounding context.

md
执行 `scripts/reconcile.py`:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 110)May include surrounding context.

md
执行 `scripts/reconcile.py`:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 121)May include surrounding context.

md
执行 `scripts/reconcile.py`:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 132)May include surrounding context.

md
执行 `scripts/reconcile.py`:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README explicitly promotes importing bank statements and accounting records and generating interactive HTML reports, but it does not warn that these inputs and outputs may contain highly sensitive financial and personal data. In this context, missing guidance on redaction, storage location, access controls, and safe sharing increases the risk of accidental data exposure through the generated report or result files.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill instructs the agent to read user-supplied financial files and generate JSON/HTML outputs, but it does not declare any explicit tool scope such as allowed-tools or permissions. That omission weakens least-privilege controls and can allow broader-than-necessary file access in a workflow handling highly sensitive banking and accounting data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough that the skill may activate on generic reconciliation or file-import requests without clear user intent to run this specific workflow. In a financial context, unintended activation can cause accidental processing of sensitive files, creation of local reports, or execution of reconciliation commands when the user expected only advice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill processes bank statements and accounting ledgers, which are highly sensitive financial records, yet it does not warn users that local JSON and HTML artifacts will be created. Without a clear warning, users may unknowingly expose account data, transaction details, counterparties, and reconciliation results through residual files stored on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code writes a JSON result file and, by default, an HTML report that include bank/book record details derived from financial statements. Although the writes are expected for the tool's purpose, the code provides no explicit user-facing warning that these output files may contain sensitive financial data and will be stored on disk unless the user opts out of HTML generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The README presents the skill instructions and parameter descriptions in Chinese only, which effectively enforces a specific language for users without opt-in or alternative language support. This can violate language/locale policy when no justification or user choice is documented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest description and trigger phrases are written as Chinese-only instructions and examples, implying the skill is designed to operate in Chinese without stating whether other languages are supported or whether Chinese is a required locale. Under the policy, forcing a specific language without user opt-in or justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The entire skill reference is written in Chinese and includes Chinese-specific terminology and bank labels, with no indication that users may choose another language or locale. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The HTML report is hard-coded with lang="zh-CN" and the interface text is rendered in Chinese, which imposes a specific language/locale choice. The file does not offer a user-selectable language option or explain that the tool is intentionally limited to a China-specific deployment context.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.