Back to skill

Security audit

现金流领航 / Cashflow Pilot

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local cash-flow bookkeeping skill, with the main caution that sensitive financial records are saved locally as plaintext JSON files.

Install only if local plaintext storage is acceptable for your business records. Use a private CFP_DATA_DIR on an encrypted disk, avoid shared folders, and review imported CSV data because crafted text could distort generated Markdown or Mermaid reports.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/utils.py:216
Finding

Sensitive Financial Records Are Created Without Explicitly Restrictive Permissions

Content
View full analysis
str: """获取数据存储目录,若不存在则自动创建。 优先读取 CFP_DATA_DIR 环境变量,否则使用默认路径。 Returns: 数据目录的绝对路径。 """ data_dir = os.environ.get("CFP_DATA_DIR", DEFAULT_DATA_DIR) os.makedirs(data_dir, exist_ok=True) return data_dir ``` ```python def save_ledger(records: List[Dict[str, Any]], ledger_file: Optional[str] = None) -> str: """保存账本数据。 Args: records: 账本记录列表。 ledger_file: 账本文件路径,默认为数据目录下的 ledger.json。 Returns: 保存的文件路径。 """ if ledger_file is None: ledger_file = os.path.join(get_data_dir(), "ledger.json") os.makedirs(os.path.dirname(ledger_file), exist_ok=True) with open(ledger_file, "w", encoding="utf-8") as f: json.dump(records, f, ensure_ascii=False, indent=2, default=str) return ledger_file ``` ```python def save_items(items: List[Dict[str, Any]], file_path: str) -> None: """保存应收/应付记录。 Args: items: 记录列表。 file_path: 数据文件路径。 """ os.makedirs(os.path.dirname(file_path), exist_ok=True) with open(file_path, "w", encoding="utf-8") as f: json.dump(items, f, ensure_ascii=False, indent=2, default=str) ``` ### Technical Analysis The application stores ledger entries, customer and vendor names, invoice information, amounts, due dates, and receivable/payable status in plaintext JSON files. Neither directory creation nor file creation specifies restrictive permission modes. Consequently, actual permissions depend on the process umask. With a common `022` umask, newly created directories may be `0755` and files may be `0644`, permitting other local accounts to traverse the data directory and read the financial records. Existing ...[truncated 1784 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cashflow_analyzer.py:202
Finding

Untrusted Financial Fields Are Embedded in Markdown and Mermaid Output Without Escaping

Content
View full analysis
0 else "expense" classification = {"type": txn_type, "category": category_str} else: classification = classify_by_amount(amount, description) return { "id": f"imp_{datetime.now().strftime('%Y%m%d%H%M%S')}_{row_num}", "date": date_val.strftime("%Y-%m-%d"), "description": description, "amount": round(abs(amount), 2), "type": classification["type"], "category": classification["category"], "source": "csv_import", "raw_row": row_num, } ``` Category names are inserted directly into Markdown and Mermaid output: ```python def _build_category_table(category_data: Dict[str, float], label: str) -> str: """生成分类明细表格 Markdown。""" if not category_data: return f"暂无{label}记录\n" total = sum(category_data.values()) lines = [f"| {label}分类 | 金额 | 占比 |\n", "|------|-----:|-----:|\n"] for cat, amount in category_data.items(): pct = amount / total if total > 0 else 0 lines.append( f"| {cat} | {format_currency(amount)} | {format_percentage(pct)} |\n" ) lines.append(f"| **合计** | **{format_currency(total)}** | **100.0%** |\n") return "".join(lines) def _build_mermaid_pie(category_data: Dict[str, float], title: str) -> str: """生成 Mermaid 饼图代码。""" if not category_data: return "" lines = [f"```mermaid\npie title {title}"] for cat, amount in category_data.items(): lines.append(f' " ...[truncated 3098 chars]
Remediation
View remediation
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 (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

声明描述强调的是企业现金流总体洞察(钱从哪来、花到哪去、还剩多少),通常意味着收入/支出/余额层面的汇总分析或报表能力。但代码并未进行现金流汇总、收支分类分析、余额计算或资金流向可视化;它主要围绕应收应付台账的录入、查询、逾期判断、提醒生成和催款通知生成。虽然应收应付管理与现金流管理相关,但这里的主功能明显更窄,且包含了未在描述中体现的具体能力(催款通知、订阅限制/付费提示)。因此描述不能准确代表该代码块的实际行为,属于明显但相关领域内的功能不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill invokes environment variables, reads user-specified files, and instructs creation/use of a local data directory, but it does not declare an explicit tool scope such as allowed tools or file path boundaries. This weakens sandboxing and reviewability: an agent/runtime may permit broader file and environment access than intended, increasing the risk of accidental or malicious data exposure through imported files or local storage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

该表述要求无条件使用中文,与语言/locale 需由用户选择或明确同意的政策要求相冲突。文件中未见提供语言切换、用户偏好检测或仅限中文场景的正当性说明。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Using broad trigger language such as 'or similar intent' for the import flow creates ambiguous activation boundaries around a sensitive action that leads to file-path collection and file parsing. This can cause the agent to enter an import workflow unexpectedly, increasing the chance of unintended file access or user confusion about what operation is being performed.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

虽然“记一笔”等短语与领域相关,但“或类似意图”扩大了触发范围,未定义哪些近似表达属于记录财务数据、哪些只是泛泛讨论。缺少负面示例或边界说明,会增加非预期调用的风险。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

该行列出示例后以“或类似意图”兜底,但没有限定范围或给出不触发的示例。对于“这个月怎么样”等接近日常表达的提问,系统可能过度推断为报告请求。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The receivables workflow can generate reminders and dunning notices, which are business-action outputs that may affect customers or payment communications. Ambiguous triggers increase the chance of entering a collections-related flow unexpectedly and could lead to inappropriate notice generation or exposure of sensitive receivable information.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

示例触发语后使用开放式表述,未说明预测功能的精确激活条件或排除语句。用户对未来经营的泛泛讨论可能被误判为要求执行预测流程。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

这一要求重复强化了单一语言强制策略,且没有用户 opt-in 机制或地区/合规依据。对于非中文用户,这可能造成不必要的语言限制并违反语言/locale 选择原则。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README markets the skill as '数据全部本地存储 — 安全放心' but does not clearly disclose that sensitive financial records are stored locally as plaintext JSON. For a bookkeeping tool handling income, expenses, receivables, and payables, this can mislead users into overestimating confidentiality and may result in sensitive business data being exposed to other local users, malware, backups, or disk compromise.

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 presents the tool description and generated report content entirely in Chinese, including docstrings and user-facing output labels. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains natural-language descriptions, help text, errors, and report content entirely in Chinese, indicating the skill is designed to operate in a single language. The file does not offer any language selection, locale fallback, or documented justification for restricting output to Chinese, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring and multiple CLI/help/error messages are presented exclusively in Chinese, which effectively forces a specific language for users of the skill. Under the policy, language constraints should offer user choice or be clearly documented as justified and region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code performs a persistent file/state modification by loading the ledger, appending a new record, and saving it, but the function contains no confirmation prompt or user-facing disclosure immediately around the write. While the function docstring says it adds a record, there is no runtime warning that the operation will permanently modify stored ledger data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module description and all user-facing strings are written exclusively in Chinese, and the code generates notices and reminders only in Chinese. This appears to impose a specific language/locale by default without any documented user opt-in or language selection mechanism.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This Python file contains natural-language documentation entirely in Chinese, and later functions expose user-facing help and error messages in Chinese as well. Under the stated policy, forcing a specific language without user opt-in is a natural-language 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

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file is entirely presented in Chinese and does not indicate that the user can select another language or that the skill is intentionally limited to a Chinese-speaking region. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.