Back to skill

Security audit

Fund Flow

Security checks for vulnerabilities and agentic risk

Overview

This is a local CSV fund-flow analysis skill with a normal optional JSON export and no evidence of network access, credential handling, persistence, or hidden execution.

Install only if you expect to analyze local Chinese/A-share fund-flow CSV files. Be careful with CSVs from untrusted sources because stock or sector names are printed directly to the terminal, and use --output only with paths where overwriting a JSON report is acceptable.

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

Warning
Location
scripts/fund_flow.py:413
Finding

Unsanitized CSV Values Permit Terminal Escape-Sequence Injection

Content
View full analysis
0 else "↓" if r['net_flow'] < 0 else "→" ratio_pct = f"{r['main_ratio']*100:.0f}%" if 'main_ratio' in r else "" print(f" {i:>4} {r['name']:<14} {r['records']:>5} {r['main_flow']:>+14,.0f} " f"{r['retail_flow']:>+14,.0f} {r['net_flow']:>+13,.0f}{direction} {ratio_pct:>6}") ``` ```python sorted_items = sorted(trends.items(), key=lambda x: -abs(x[1]["3day_avg"]))[:top] for name, t in sorted_items: print(f" {name:<14} {t['3day_avg']:>+12,.0f} {t['3day_direction']:<8} " f"{t['5day_avg']:>+12,.0f} {t['5day_direction']:<8} {t['persistence']:>6}") ``` ```python for s in sectors[:top]: direction = "↑" if s['net_flow'] > 0 else "↓" ratio_pct = f"{s['main_ratio']*100:.0f}%" print(f" {s['sector']:<12} {s['items']:>5} {s['members']:>5} {s['main_flow']:>+14,.0f} " f"{s['retail_flow']:>+14,.0f} {s['net_flow']:>+14,.0f} {ratio_pct:>6}") ``` ### Technical Analysis The application treats CSV fields such as stock names and sector names as ordinary display text. These values can contain control characters, including ANSI CSI sequences and OSC sequences, and are passed directly to `print()`. Python string formatting does not neutralize terminal control sequences. When the report is displayed in a compatible terminal emulator, the terminal interprets those bytes as command ...[truncated 2183 chars]
Remediation
View remediation
= 0x20 and ord(ch) != 0x7F ) ``` 2. Sanitize names and sectors at each output boundary: ```python safe_name = sanitize_terminal_text(r["name"]) print(f" {i:>4} {safe_name:<14} ...") ``` 3. Apply the same protection consistently to: - Ranking names. - Trend names. - Sector names. - Any future user-controlled labels, headings, filenames, or error messages. 4. Consider rendering control characters visibly rather than removing them when forensic fidelity is important, for example by replacing them with escaped forms such as `\x1b`. 5. Add automated tests containing CSI, OSC 8, OSC 52, carriage return, backspace, newline, and other C0/C1 control characters. Verify that generated terminal reports contain no executable control sequences. 6. Keep machine-readable JSON output separate from human-readable terminal output. Avoid printing both formats together when `--json` is selected, and document that downstream consumers must safely encode values for their own display context. ]]>
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 (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises '纯本地运行' and '只读CSV数据文件', but its usage includes an --output option that writes files while the manifest does not declare any explicit tool scope such as allowed-tools or permissions. This creates an authorization and review gap: the skill can read and write local files without a clearly bounded declaration, increasing the chance of unintended file access or output placement if integrated into an agent runtime.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger list includes a broad phrase like '股票分析', which can cause the skill to activate in many generic investing conversations beyond fund-flow analysis. Over-broad activation increases the chance that an agent invokes this skill on unrelated user requests or with unsuitable data, leading to unintended file access or misleading analysis in contexts where the user did not ask for this specific capability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file uses Chinese for the visible changelog title and section labels, which imposes a specific language on readers without any opt-in or explanation. Under the policy rule, locale or language restrictions should either provide user choice or be clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The visible user-facing instructions and feature description are presented exclusively in Chinese, which can amount to a language/locale policy violation when no opt-in or alternative language is offered. The file does not indicate that the skill is intentionally region-specific or provide users with a language choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

Key operational text such as the description, use conditions, and trigger keywords is presented only in Chinese, while the file does not state that the skill is region-specific or offer an explicit language option. This can violate a language/locale policy when users are not given a choice or informed of the locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest sets "region": "cn", which is a natural-language locale constraint embedded in configuration. There is no accompanying indication here that users can choose another locale or that the restriction is explicitly justified within this file, so it may violate the policy against forcing a specific locale without opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest emphasizes local fund-flow analysis over CSV data and does not mention producing or saving files, which implies a read/compute/report workflow. The code adds a persistent write capability via --output and writes JSON to any user-specified path, expanding behavior beyond analysis/display.

Content

No source excerpt is available for this finding.