Back to skill

Security audit

Finlab

Security checks for vulnerabilities and agentic risk

Overview

This FinLab skill is mostly a trading and backtesting guide, but it also includes live broker order execution and credential handling without strong confirmation or safety boundaries.

Install only after reviewing the live-trading sections. Use an isolated locked Python environment, avoid system-wide installs, do not paste real broker credentials or tokens into chats or notebooks, keep experimental backtests at `upload=False`, and use preview-only or paper trading unless you explicitly approve the exact orders, account, quantities, and prices.

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

T08 · Insecure Dependencies

Error
Location
SKILL.md:35
Finding

Unpinned Third-Party Dependencies Are Installed and Executed

Content
View full analysis
=1.5.9" 2>/dev/null || uv pip install "finlab>=1.5.9" ``` ```bash uv run --with "finlab" python3 script.py ``` Additional unpinned installation instructions include: ```bash pip install finlab --upgrade ``` ```bash pip install esun-trade ``` ```bash pip install shioaji ``` ### Technical Analysis The Skill instructs the Agent to download and execute third-party packages without pinning exact versions or verifying package hashes. The constraint `finlab>=1.5.9` permits any future matching release, while `--upgrade` and package names without versions explicitly select package contents that may change after this Skill has been audited. The `--system` option is particularly unsafe because it modifies the system Python environment instead of an isolated project environment. Installation and subsequent import can execute package-controlled build hooks, initialization code, native extensions, and runtime logic. The source code of these dependencies is not included in the audited project, so its behavior cannot be verified from this repository. This creates a software supply-chain exposure. A compromised publisher account, malicious future release, dependency confusion condition, or compromised transitive dependency could introduce arbitrary code into the execution environment. ### Attack Path 1. An attacker compromises a referenced package, its publisher account, or one of its transitive dependencies. 2. The attacker publishes a malicious release satisfying the unbounded version requirement. 3. The Agent follows the Skill and ...[truncated 1313 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
backtesting-reference.md:15
Finding

Backtest Reports May Be Uploaded Without Explicit User Consent

Content
View full analysis
report.Report ``` The parameter documentation confirms the external action: ```markdown #### upload - **Type:** `bool` - **Default:** `True` - **Description:** Determines whether to upload the strategy performance report after simulation. ``` Runnable examples omit the safe override: ```python import pandas as pd from finlab import backtest position = pd.DataFrame({ '2330': [0, 1, 1], '1101': [0.2, 0, 0], '2454': [0.4, 0, 0] }, index=pd.to_datetime(['2021-12-31', '2022-03-31', '2022-06-30'])) report = backtest.sim(position) print(report) ``` ```python report = backtest.sim( position, resample='M', stop_loss=0.1, take_profit=0.2, name='MA Strategy with ...[truncated 2160 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:243
Finding

Live Broker Orders Can Be Submitted Without a Mandatory Confirmation Boundary

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The markdown includes actionable live order execution steps, culminating in a real order placement call, without an explicit warning that this can place real trades or cause financial loss. In context, the 'Shut Up and Run It' execution philosophy makes this more dangerous by encouraging direct action rather than cautious review.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file adds live trading and order execution capabilities even though the skill metadata describes an analysis/backtesting-focused assistant. In an agent setting, this scope expansion is dangerous because it can prompt credential collection and real-money trading actions that users would not reasonably expect from a research-oriented skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented methods create, modify, and cancel live orders, enabling direct market actions from a skill whose declared purpose is research and backtesting. This mismatch materially increases risk because an agent or user may treat the skill as safe analytical guidance while it actually facilitates real-money trading operations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description includes broad triggers such as trading, stock market analysis, and strategy development, which can cause the skill to activate for general financial queries not specifically about FinLab. Over-broad routing can expose users to high-risk trading workflows or domain-specific assumptions in contexts where they did not request them.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill goes beyond backtesting/documentation and provides concrete steps to connect a real broker account and execute orders. In an agent setting, this materially increases the chance of unauthorized or insufficiently confirmed real-world financial actions, especially because the skill elsewhere emphasizes execution over explanation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill documents Line notification support, including a line_access_token parameter, without warning that enabling notifications transmits trading-related data and requires handling a credential. This can lead users to expose sensitive strategy outputs or mishandle access tokens, especially if they copy examples into shared notebooks, logs, or source control.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation states that upload defaults to True, which means strategy performance data may be transmitted to an external service without an explicit warning or opt-in at the point of use. In a quantitative trading context, uploaded reports can contain proprietary strategy logic, holdings, symbols, timing, and performance characteristics, creating confidentiality and compliance risks if users are unaware of the external transmission.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill documentation relies heavily on Chinese field names, category names, and example outputs throughout the file, with no indication that users can choose another language or locale. Under the stated policy, forcing a specific language or locale without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · data-reference.md (reported line 486)May include surrounding context.

md
|------|------|---------|-------------|
| `data.use_local_data_only` | bool | False | Prevent cloud downloads; use only local cache. Raises error if data not cached. |
| `data.force_cloud_download` | bool | False | Always download fresh data from cloud, ignoring cache. |
| `data.prefer_local_if_exists` | bool | False | Use local cache without checking expiry. Faster startup. |
| `data.truncate_start` | str/None | None | Filter data to start from this date (format: `'YYYY-MM-DD'`). |
| `data.truncate_end` | str/None | None | Filter data to end at this date (format: `'YYYY-MM-DD'`). |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file includes numerous concrete trading and backtesting examples that can be readily copied into workflows, but it does not include an explicit educational-only / not-financial-advice disclaimer near those examples. In a quant-trading skill, users may over-trust example strategies as endorsed or suitable for deployment, increasing the risk of harmful real-world financial decisions even though no direct code-execution exploit is present.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section instructs users to handle brokerage credentials, account passwords, certificate paths, and personal identifiers through environment variables and code examples. In the context of an agent skill, that creates a pathway for secret exposure and unauthorized account access, especially because broker integration is outside the stated purpose of the skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation begins credential and broker-integration guidance without any explicit warning about sensitive data, financial risk, or safe secret handling. In an assistant context, this omission makes unsafe behavior more likely by normalizing direct entry of passwords and identifiers into examples.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains substantial Traditional Chinese content in code examples and later sections, but the document never states that the skill is Taiwan/Traditional-Chinese specific or offers an alternative language. Under the policy, forcing a specific language or locale without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This section switches entirely to Traditional Chinese and includes a timezone-specific operational instruction tied to UTC+8. Because the file does not explain that the skill is region-specific or provide a language/locale alternative, this can amount to an undocumented language/locale constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The file explains that FinLab caches data locally and can re-download from the cloud, including examples using data.force_cloud_download = True, but it does not warn that these operations initiate network access and may transmit request metadata or usage context. For markdown files, behaviors affecting privacy or system/network activity should be disclosed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file describes data.clear() as clearing all cached data from the current storage backend and shows calling it directly, but it does not warn that this may delete locally cached files or remove data needed for offline use. For markdown files, safety-affecting behaviors that can impact user data should include a clear warning.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Natural-language content and many code identifiers are presented in Chinese throughout the file, while the document does not offer an alternative language option or explain that the skill is specifically intended for a Chinese/Taiwan-market audience. Under the language/locale policy rule, forcing a specific language without user opt-in can be a policy concern 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
76% confidence
Finding

This markdown file includes example identifiers and data fields in Chinese, such as 股價淨值比, 當月營收, and ROE稅後, without stating that the skill is Taiwan/Chinese-market specific or offering an English/localized alternative. That can create a locale/language policy concern because the documentation implicitly assumes a specific language context without user opt-in or justification.

Content

No source excerpt is available for this finding.