Back to skill

Security audit

ETF模拟交易回测系统

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent simulated ETF backtesting tool, but its financial signals rely on unauthenticated plaintext market-data requests that could be tampered with.

Review before installing if you might rely on its outputs for financial decisions. It does not appear to trade real money or access accounts, but its market data can be manipulated on the network because it uses HTTP, and the generated buy/sell signals should be treated as educational simulation only.

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

Error
Location
scripts/trade.py:29
Finding

Unauthenticated Plaintext Transport Enables Market-Data and Trading-Signal Manipulation

Content
View full analysis

Vulnerability Details

File Location: scripts/trade.py, lines 29 and 50
Vulnerability Type: T09: Insecure Skill Coding Practices
Risk Level: High

Vulnerable Code

Real-time market data is requested over plaintext HTTP:

python
url = f"http://push2.eastmoney.com/api/qt/stock/get"

Historical market data is also requested over plaintext HTTP:

python
url = "http://push2his.eastmoney.com/api/qt/stock/kline/get"

Technical Analysis

The application retrieves both current quotes and historical candles through unencrypted and unauthenticated HTTP connections. HTTP provides no server authentication, confidentiality, or response-integrity protection.

An on-path attacker, malicious network operator, compromised proxy, or hostile access point can intercept these requests and return syntactically valid but falsified JSON. The application parses the responses without independently verifying their origin or comparing them with another trusted source. The resulting price, volume, and candle values flow directly into BOLL, MACD, and KDJ calculations and are then used to generate trading signals and backtest results.

Request timeouts limit availability problems but do not protect authenticity or integrity.

Attack Path

  1. A user runs the skill while connected through a network controlled or observable by an attacker.
  2. The script sends a plaintext HTTP request to an East Money quote or history endpoint.
  3. The attacker intercepts the request and supplies a forged but structurally valid JSON response.
  4. The script accepts attacker-selected prices, volumes, or historical candles.
  5. generate_signals() calculates technical indicators from the manipulated input.
  6. The skill presents fabricated buy or sell signals, stop-loss outcomes, or misleading backtest metrics.
  7. A user may rely on that output when making financial decisions.

Impact Assessment

The attacker does not obt ...[truncated 672 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace both plaintext endpoints with official HTTPS endpoints.
  2. Keep TLS certificate verification enabled and fail closed when certificate validation fails.
  3. Do not implement insecure fallbacks from HTTPS to HTTP.
  4. Validate each response before use, including:
    • Expected JSON structure and required fields
    • Requested symbol identity
    • Timestamp freshness and chronological ordering
    • Numeric types and plausible price and volume ranges
    • Candle consistency, such as low being no greater than high
  5. Cross-check financially consequential prices or signals against an independent trusted data source.
  6. Reject malformed, stale, incomplete, or inconsistent data instead of continuing calculations.
  7. Log data-source and validation failures without exposing sensitive environment information.
  8. Preserve the simulation-only boundary. Do not connect generated signals to real order execution without authenticated data feeds, stronger integrity checks, explicit user confirmation, and additional risk controls.
Vulnerability Patterns
  • 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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill describes capabilities to fetch real-time and historical market data, which implies network access, but it does not declare any tool scope or allowed-tools boundaries. This creates an authorization and governance gap: the runtime may permit broader-than-intended external access or reviewers may be unable to verify what outbound actions are expected.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description embeds trigger wording like '当用户提及…时触发此skill' without clear invocation boundaries, making activation criteria ambiguous at the metadata level. In a financial-analysis context, ambiguous activation is more risky because casual mention of ETF trading terms could invoke a workflow that fetches market data or produces trading-style outputs unexpectedly.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list contains broad phrases such as '股票回测', '回测分析', and '技术指标交易', which are common in ordinary finance conversations. This can cause unintended activation, pulling the agent into a trading/backtesting workflow when the user may only be discussing concepts, increasing the chance of irrelevant execution paths or unnecessary data access.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing natural-language descriptions entirely in Chinese, presenting the skill as a Chinese-language trading/backtesting system without offering any language or locale choice. Per the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest emphasizes ETF simulated trading and backtest analysis, which suggests offline or historical-strategy evaluation. This file additionally exposes a realtime trading entrypoint that fetches current market quotes and generates live signals, expanding behavior beyond pure backtesting analysis.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The configuration uses a Chinese-only product name string with no indication that the skill is region-specific or that users can choose a preferred language/locale. Under the policy, hard-coding a specific language without opt-in can be a natural-language policy violation unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

The code calls Eastmoney HTTP APIs to fetch realtime and historical data. While data access can support backtesting, the manifest does not explicitly say the skill reaches out to third-party network services, and the realtime quote capability is especially not clearly justified by the stated backtest-focused purpose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.